0
Files
src/third_party/blink/web_tests/shadow-dom/window-event.html
Mason Freed 41baca1fa9 Update more WCv0 tests to WCv1
This CL contains manual modifications to a handful of tests that use
Shadow DOM v0, to attempt to upgrade them to SDv1. This CL also includes
the movement of several tests (which turned out to be V0 only tests)
to the web-components-v0-only folder, which will eventually be deleted.

Of particular concern for review:
 fast/css/cache/matched-properties-cache-no-flat-tree-parent.html
 fast/css/invalidation/shadow-add-sheet-content.html
 fast/css/boundary-crossing-scopes-null-resolver-crash.html

In this test, I simply deleted the V0-specific part of the test:
 shadow-dom/window-event.html

And since this test can't be moved easily, and it only tests the
(v0 specific) ::content selector, I just deleted it:
 inspector-protocol/css/css-shadow-host-content-selector.js

Bug: 937746
Change-Id: I74967e65b1a0ec52e2014b40d25b84107b4c46d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2243692
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#778435}
2020-06-15 19:40:41 +00:00

35 lines
1.2 KiB
HTML

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="test">
<div id="normal-div"></div>
<div id="shadow-host-v0"></div>
<div id="shadow-host-v1"></div>
</div>
<script>
const normalDiv = document.querySelector('#normal-div');
const shadowHostV1 = document.querySelector('#shadow-host-v1');
shadowHostV1.attachShadow({mode : 'open'});
const test_event = new Event('test_event');
async_test((test) => {
normalDiv.addEventListener('test_event', test.step_func_done((e) => {
assert_not_equals(event, null);
assert_equals(event, e);
assert_equals(event, test_event);
}));
normalDiv.dispatchEvent(test_event);
}, 'window.event should contain the current event being handled when the target is a normal DOM node');
async_test((test) => {
shadowHostV1.shadowRoot.addEventListener('test_event', test.step_func_done((e) => {
assert_equals(event, undefined);
assert_not_equals(event, e);
}));
shadowHostV1.shadowRoot.dispatchEvent(test_event);
}, 'window.event should be undefined when the target of the current event being handled is a V1 Shadow DOM node');
</script>