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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/detached-element.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 tests that querySelector, querySelectorAll and matchesSelector (webkitMatc hesSelector) work with elements that are not in a document yet."
3 );
4
5 var root = document.createElement('div');
6 var correctNode = document.createElement('div');
7 correctNode.setAttribute("id", "testId")
8 root.appendChild(correctNode);
9 var noChild = document.createElement('div');
10
11 shouldBe("root.querySelector('div')", "correctNode");
12 shouldBe("root.querySelector('#testId')", "correctNode");
13
14 shouldBe("root.querySelectorAll('div').length", "1");
15 shouldBe("root.querySelectorAll('div').item(0)", "correctNode");
16 shouldBe("root.querySelectorAll('#testId').length", "1");
17 shouldBe("root.querySelectorAll('#testId').item(0)", "correctNode");
18
19 shouldBeNull("noChild.querySelector('div')");
20 shouldBe("noChild.querySelectorAll('div').length", "0");
21
22 shouldBeTrue("correctNode.webkitMatchesSelector('div')");
23 shouldBeTrue("correctNode.webkitMatchesSelector('#testId')");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698