Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js

Issue 2051373002: Rewrite and organize tests in LayoutTests/shadow-dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean-test2-3
Patch Set: rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js b/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
index c11861a1321ad0fb2cd6a5336233d5f9105bb0b8..f17927726f861685cec628f0659f5d7140250e23 100644
--- a/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
+++ b/third_party/WebKit/LayoutTests/shadow-dom/resources/shadow-dom.js
@@ -72,7 +72,13 @@ function createTestTree(node) {
function attachShadowFromTemplate(template) {
let parent = template.parentNode;
parent.removeChild(template);
- let shadowRoot = parent.attachShadow({mode: template.getAttribute('data-mode')});
+ let shadowRoot;
+ if (template.getAttribute('data-mode') === 'v0') {
+ // For legacy Shadow DOM
+ shadowRoot = parent.createShadowRoot();
+ } else {
+ shadowRoot = parent.attachShadow({mode: template.getAttribute('data-mode')});
+ }
let id = template.id;
if (id) {
shadowRoot.id = id;
@@ -158,6 +164,14 @@ function dispatchUAEventWithLog(nodes, target, eventType, callback) {
return log;
}
+function makeExpectedEventPathLog(path) {
+ let expectedLog = [];
+ for (let i of path) {
+ expectedLog.push([i, null, path]);
+ }
+ return expectedLog;
+}
+
// This function assumes that testharness.js is available.
function assert_event_path_equals(actual, expected) {
assert_equals(actual.length, expected.length);

Powered by Google App Engine
This is Rietveld 408576698