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

Side by Side Diff: LayoutTests/fast/dom/Node/script-tests/contains-method.js

Issue 978223002: Add [TypeChecking=Interface] to Node interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update test wrt isSameNode() change Created 5 years, 9 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 description( 1 description(
2 'This test checks behavior of Node.contains. <div id="test1">[test1 <span id="te st2">[test 2]</span>]</div>' 2 'This test checks behavior of Node.contains. <div id="test1">[test1 <span id="te st2">[test 2]</span>]</div>'
3 ); 3 );
4 4
5 var test1 = document.getElementById('test1'); 5 var test1 = document.getElementById('test1');
6 var test1TextChild = document.getElementById('test1').firstChild; 6 var test1TextChild = document.getElementById('test1').firstChild;
7 var test2 = document.getElementById('test2'); 7 var test2 = document.getElementById('test2');
8 8
9 shouldBeEqualToString("typeof document.contains", "function"); 9 shouldBeEqualToString("typeof document.contains", "function");
10 shouldBeTrue("test1.contains(test2)"); 10 shouldBeTrue("test1.contains(test2)");
11 shouldBeTrue("test1.contains(test1TextChild)"); 11 shouldBeTrue("test1.contains(test1TextChild)");
12 shouldBeTrue("document.contains(test1)"); 12 shouldBeTrue("document.contains(test1)");
13 shouldBeTrue("document.contains(test1TextChild)"); 13 shouldBeTrue("document.contains(test1TextChild)");
14 shouldBeTrue("document.contains(document)"); 14 shouldBeTrue("document.contains(document)");
15 shouldBeTrue("test1.contains(test1)"); 15 shouldBeTrue("test1.contains(test1)");
16 shouldBeTrue("test1TextChild.contains(test1TextChild)"); 16 shouldBeTrue("test1TextChild.contains(test1TextChild)");
17 shouldBeFalse("test1.contains(123)"); 17 shouldThrow("test1.contains(123)");
18 shouldBeFalse("test1.contains(null)"); 18 shouldBeFalse("test1.contains(null)");
19 19
20 // Cross document tests 20 // Cross document tests
21 var iframe = document.createElement("iframe"); 21 var iframe = document.createElement("iframe");
22 22
23 shouldBeFalse("document.contains(iframe)"); // Not in document 23 shouldBeFalse("document.contains(iframe)"); // Not in document
24 shouldBeTrue("iframe.contains(iframe)"); 24 shouldBeTrue("iframe.contains(iframe)");
25 25
26 document.body.appendChild(iframe); 26 document.body.appendChild(iframe);
27 debug('iframe is now in document'); 27 debug('iframe is now in document');
28 shouldBeTrue("document.contains(iframe)"); 28 shouldBeTrue("document.contains(iframe)");
29 29
30 var iframeDoc = iframe.contentDocument; 30 var iframeDoc = iframe.contentDocument;
31 var iframeBody = iframeDoc.body; 31 var iframeBody = iframeDoc.body;
32 32
33 shouldBeFalse("document.contains(iframeDoc)"); 33 shouldBeFalse("document.contains(iframeDoc)");
34 shouldBeTrue("iframeDoc.contains(iframeBody)"); 34 shouldBeTrue("iframeDoc.contains(iframeBody)");
35 shouldBeFalse("document.contains(iframeBody)"); 35 shouldBeFalse("document.contains(iframeBody)");
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Node/contains-method-expected.txt ('k') | LayoutTests/fast/dom/incompatible-operations.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698