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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/surround-contents-with-shadow-dom.html

Issue 2074393002: Clean up shadow-dom layout tests so that they are well organized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/shadow-dom.js"></script>
5 <div id="targets">
6 <div id="T0">
7 <div id="normal-target">Normal</div>
8 </div>
9
10 <div id="T1">
11 <template><div id="target">Shadow</div></template>
12 </div>
13
14 <div id="T2">
15 <template>
16 <div id="H">
17 <template><div id="target">Shadow in shadow</div></template>
18 </div>
19 </template>
20 </div>
21
22 <details id="T3"><div id="details-target">P3</div></details>
23 </div>
24 <script>
25 convertTemplatesToShadowRootsWithin(targets);
26
27 testSurroundContents("Normal", "normal-target", T0);
28 testSurroundContents("Shadow", "T1/target", T1);
29 testSurroundContents("Multi-level shadow", "T2/H/target", T2);
30 testSurroundContents("<details>", "details-target", T3);
31
32 function testSurroundContents(description, targetPath, newParent) {
33 test(function () {
34 var target = getNodeInComposedTree(targetPath);
35 var range = document.createRange();
36 range.selectNode(target);
37 assert_throws("HierarchyRequestError", function () {
38 range.surroundContents(newParent);
39 });
40 var targetAfter = getNodeInComposedTree(targetPath);
41 assert_equals(targetAfter, target, "DOM should not change after Hierarch yRequestError");
42 }, description);
43 }
44
45 if (window.testRunner)
46 targets.style.display = "none";
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698