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

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

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
(Empty)
1 description(
2 'This test checks behavior of Node.contains. <div id="test1">[test1 <span id="te st2">[test 2]</span>]</div>'
3 );
4
5 var test1 = document.getElementById('test1');
6 var test1TextChild = document.getElementById('test1').firstChild;
7 var test2 = document.getElementById('test2');
8
9 shouldBeEqualToString("typeof document.contains", "function");
10 shouldBeTrue("test1.contains(test2)");
11 shouldBeTrue("test1.contains(test1TextChild)");
12 shouldBeTrue("document.contains(test1)");
13 shouldBeTrue("document.contains(test1TextChild)");
14 shouldBeTrue("document.contains(document)");
15 shouldBeTrue("test1.contains(test1)");
16 shouldBeTrue("test1TextChild.contains(test1TextChild)");
17 shouldThrow("test1.contains(123)");
18 shouldBeFalse("test1.contains(null)");
19
20 // Cross document tests
21 var iframe = document.createElement("iframe");
22
23 shouldBeFalse("document.contains(iframe)"); // Not in document
24 shouldBeTrue("iframe.contains(iframe)");
25
26 document.body.appendChild(iframe);
27 debug('iframe is now in document');
28 shouldBeTrue("document.contains(iframe)");
29
30 var iframeDoc = iframe.contentDocument;
31 var iframeBody = iframeDoc.body;
32
33 shouldBeFalse("document.contains(iframeDoc)");
34 shouldBeTrue("iframeDoc.contains(iframeBody)");
35 shouldBeFalse("document.contains(iframeBody)");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698