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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/node-isConnected.html

Issue 1855823003: Implement Node.isConnected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src='../resources/testharness.js'></script>
3 <script src='../resources/testharnessreport.js'></script>
4 <div id="log"></div>
5 <div id="host"></div>
6 <script>
7
8 var host = document.getElementById('host');
9 host.attachShadow({mode: 'open'});
10 var orphan1 = document.createElement('div');
kochi 2016/04/05 05:32:28 Now you can move these 2 lines into the test funct
yuzuchan 2016/04/05 06:48:48 Done.
11
12 test(function() {
13 assert_false(orphan1.isConnected);
14 host.shadowRoot.appendChild(orphan1);
15 assert_true(orphan1.isConnected);
16 }, 'When inserted into a connected shadow tree, isConnected should be true.');
17
18 test(function() {
kochi 2016/04/05 05:32:28 Probably this test should come first, before the t
yuzuchan 2016/04/05 06:48:48 Done.
19 var orphan2 = document.createElement('div');
kochi 2016/04/05 05:32:28 How about adding assert_false(orphan2.isConnected)
yuzuchan 2016/04/05 06:48:48 Done.
20 host.appendChild(orphan2);
21 assert_true(orphan2.isConnected);
22 }, 'When inserted into a document tree, isConnected should be true.');
23
24 test(function() {
25 var orphan3 = document.createElement('div');
26 var host2 = document.createElement('div');
27 host2.attachShadow({mode: 'open'});
28 host2.shadowRoot.appendChild(orphan3);
29 assert_false(host2.isConnected);
30 assert_false(host2.shadowRoot.isConnected);
31 assert_false(orphan3.isConnected);
32 }, 'When inserted into a detached tree, isConnected should be false.');
33
34 test(function() {
35 var orphan4 = document.createElement('div');
36 var host3 = document.createElement('div');
37 var host4 = document.createElement('div');
38 host3.attachShadow({mode: 'open'});
39 host4.attachShadow({mode: 'open'});
40 host4.shadowRoot.appendChild(orphan4);
41 host3.shadowRoot.appendChild(host4);
42 assert_false(host3.isConnected);
43 assert_false(host3.shadowRoot.isConnected);
44 assert_false(host4.isConnected);
45 assert_false(host4.shadowRoot.isConnected);
46 assert_false(orphan4.isConnected);
kochi 2016/04/05 05:32:28 How about adding host.appendChild(host3); here and
yuzuchan 2016/04/05 06:48:48 Done.
47 }, 'When inserted into a detached shadow tree, isConnected should be false.');
48
49 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698