Commit e092e647 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Move <content> element tests to web components v0 folder

This is part of a multi-CL set that will move all "Web Components v0
only" tests into a separate folder. This will make landing the eventual
removal of WCv0 easier, because this entire folder can simply be skipped
rather than requiring file-by-file changes. There should not be any
tests in this folder that are needed for testing Web Components
VERSION 1 features.

While this CL does not change any behavior or testing now, care should
be taken in reviewing the list of tests, since when WCv0 is removed,
all of these tests will be deleted. So any tests being moved here that
are required for testing a non-WCv0 feature should *not* be included in
this move.

This set should only include tests of the (Shadow DOM v0 specific)
<content> element.

Bug: 937746
Change-Id: I60d0d1df2ff3b35572f0af7c7bbad6213a47a05b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209247
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770372}
parent 829eebab
...@@ -3836,12 +3836,6 @@ crbug.com/789139 http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ F ...@@ -3836,12 +3836,6 @@ crbug.com/789139 http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ F
# Ignore these - they are tests of the disabled features. Eventually remove these. # Ignore these - they are tests of the disabled features. Eventually remove these.
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-after-style.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-after-style.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-in-media-element.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-in-meter-element.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-in-progress-element.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-in-select-element.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-move.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-select-dynamic.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-dynamic-attribute-change.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-dynamic-attribute-change.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-dynamic.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-dynamic.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/distribution-attribute-modified.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/distribution-attribute-modified.html [ Skip ]
...@@ -3867,13 +3861,9 @@ crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tapH ...@@ -3867,13 +3861,9 @@ crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tapH
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/scrollbar.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/scrollbar.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-select.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-select.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-insertion-point-rendering.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/style-sharing-with-content-and-host.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/style-sharing-with-content-and-host.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree.xhtml [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree.xhtml [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/text-node-in-shadow.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/text-node-in-shadow.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-fallback-display-none-dynamic.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-outside-shadow-style.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-element-select-namespace.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-all.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-all.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-descendant.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-descendant.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-nested.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-nested.html [ Skip ]
...@@ -3896,8 +3886,6 @@ crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-conte ...@@ -3896,8 +3886,6 @@ crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-conte
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-on-image.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-on-image.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-complex-shadow.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-complex-shadow.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-without-shadow.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-without-shadow.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-1.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-2.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-of-insertionpoint.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-of-insertionpoint.html [ Skip ]
crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/table-border.html [ Skip ] crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/table-border.html [ Skip ]
......
//
// shadow-test-driver.js
//
// To use shadow-test-driver.js, you should have
// <div id="actual-container"></div>
// <div id="expect-container"></div>
// <pre id="console"></pre>
// in your body.
//
// Then, define test functions having one argument 'callIfDone'.
// callIfDone should be called when your test function finished.
//
// In body.onload, call doTest(testFuncs) where testFuncs is an array of test functions.
//
// See content-element-move.html as an example.
//
function log(message) {
document.getElementById('console').innerHTML += (message + "\n");
}
function removeAllChildren(elem) {
while (elem.firstChild)
elem.removeChild(elem.firstChild);
}
function cleanUp() {
removeAllChildren(document.getElementById('actual-container'));
removeAllChildren(document.getElementById('expect-container'));
}
function removeContainerLines(text) {
var lines = text.split('\n');
lines.splice(0, 2);
return lines.join('\n');
}
function check() {
var expectContainer = document.getElementById('expect-container');
var actualContainer = document.getElementById('actual-container');
var originalDisplayValue = actualContainer.style.display;
actualContainer.style.display = 'none';
expectContainer.offsetLeft;
var refContainerLayoutTree = internals.elementLayoutTreeAsText(expectContainer);
var refLayoutTree = removeContainerLines(refContainerLayoutTree);
actualContainer.style.display = originalDisplayValue;
originalDisplayValue = expectContainer.style.display;
expectContainer.style.display = 'none';
actualContainer.offsetLeft;
var targetContainerLayoutTree = internals.elementLayoutTreeAsText(actualContainer);
var targetLayoutTree = removeContainerLines(targetContainerLayoutTree);
expectContainer.style.display = originalDisplayValue;
if (targetLayoutTree == refLayoutTree)
log("PASS");
else {
log("FAIL");
log("Expected: ");
log(refLayoutTree);
log("Actual: ");
log(targetLayoutTree);
}
}
function createSpanWithText(text, className) {
var span = document.createElement('span');
span.appendChild(document.createTextNode(text));
if (className)
span.className = className;
return span;
}
function createContentWithSelect(select, fallbackText) {
var content = document.createElement('content');
content.setAttribute('select', select);
if (fallbackText)
content.appendChild(createSpanWithText(fallbackText));
return content;
}
function createContentWithText(fallbackText) {
var content = document.createElement('content');
if (fallbackText)
content.innerHTML = fallbackText;
return content;
}
function appendShadow(target, select) {
var root = target.createShadowRoot();
var content = document.createElement('content');
content.setAttribute('select', select);
content.appendChild(createSpanWithText("FALLBACK"));
root.appendChild(document.createTextNode("{SHADOW: "));
root.appendChild(content);
root.appendChild(document.createTextNode("}"));
}
function appendShadowDeep(target, select) {
var root = target.createShadowRoot();
var child = document.createElement("span");
{
var content = document.createElement('content');
content.setAttribute('select', select);
content.appendChild(createSpanWithText("FALLBACK"));
child.appendChild(document.createTextNode("{INNER: "));
child.appendChild(content);
child.appendChild(document.createTextNode("}"));
}
root.appendChild(document.createTextNode("{SHADOW: "));
root.appendChild(child);
root.appendChild(document.createTextNode("}"));
}
function doTestIfLeft(restTests) {
var test = restTests.shift();
if (test == null)
return doneTest();
var callIfDone = function() {
setTimeout(function() {
check();
cleanUp();
doTestIfLeft(restTests);
}, 0);
};
log(test.name);
test(callIfDone);
}
function doneTest() {
log("TEST COMPLETED");
if (window.tearDownOnce)
window.tearDownOnce();
testRunner.notifyDone();
}
// A test driver. Call this body.onload.
function doTest(tests) {
if (window.setUpOnce)
window.setUpOnce();
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
cleanUp();
doTestIfLeft(tests);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment