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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/id-fastpath.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 the querySelector and querySelectorAll fast path for IDs is not overzelous."
3 );
4
5 var root = document.createElement('div');
6 var correctNode = document.createElement('div');
7 correctNode.setAttribute("id", "testid")
8 root.appendChild(correctNode);
9 document.body.appendChild(root);
10
11 shouldBe("document.querySelector('div#testid')", "correctNode");
12 shouldBe("document.querySelector('#testid')", "correctNode");
13 shouldBeNull("document.querySelector('ul#testid')");
14 shouldBeNull("document.querySelector('ul #testid')");
15 shouldBeNull("document.querySelector('#testid[attr]')");
16 shouldBeNull("document.querySelector('#testid:not(div)')");
17
18 shouldBe("document.querySelectorAll('div#testid').length", "1");
19 shouldBe("document.querySelectorAll('div#testid').item(0)", "correctNode");
20 shouldBe("document.querySelectorAll('#testid').length", "1");
21 shouldBe("document.querySelectorAll('#testid').item(0)", "correctNode");
22 shouldBe("document.querySelectorAll('ul#testid').length", "0");
23 shouldBe("document.querySelectorAll('ul #testid').length", "0");
24 shouldBe("document.querySelectorAll('#testid[attr]').length", "0");
25 shouldBe("document.querySelectorAll('#testid:not(div)').length", "0");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698