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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Node/contains-method.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 10 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
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script src="script-tests/contains-method.js"></script> 7 <script>
8 description(
9 'This test checks behavior of Node.contains. <div id="test1">[test1 <span id="te st2">[test 2]</span>]</div>'
10 );
11
12 var test1 = document.getElementById('test1');
13 var test1TextChild = document.getElementById('test1').firstChild;
14 var test2 = document.getElementById('test2');
15
16 shouldBeEqualToString("typeof document.contains", "function");
17 shouldBeTrue("test1.contains(test2)");
18 shouldBeTrue("test1.contains(test1TextChild)");
19 shouldBeTrue("document.contains(test1)");
20 shouldBeTrue("document.contains(test1TextChild)");
21 shouldBeTrue("document.contains(document)");
22 shouldBeTrue("test1.contains(test1)");
23 shouldBeTrue("test1TextChild.contains(test1TextChild)");
24 shouldThrow("test1.contains(123)");
25 shouldBeFalse("test1.contains(null)");
26
27 // Cross document tests
28 var iframe = document.createElement("iframe");
29
30 shouldBeFalse("document.contains(iframe)"); // Not in document
31 shouldBeTrue("iframe.contains(iframe)");
32
33 document.body.appendChild(iframe);
34 debug('iframe is now in document');
35 shouldBeTrue("document.contains(iframe)");
36
37 var iframeDoc = iframe.contentDocument;
38 var iframeBody = iframeDoc.body;
39
40 shouldBeFalse("document.contains(iframeDoc)");
41 shouldBeTrue("iframeDoc.contains(iframeBody)");
42 shouldBeFalse("document.contains(iframeBody)");
43 </script>
8 </body> 44 </body>
9 </html> 45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698