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

Unified Diff: sky/tests/lowlevel/query-selector.sky

Issue 815613002: Fix attribute selectors. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/css/parser/CSSGrammar.y ('k') | sky/tests/lowlevel/query-selector-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/lowlevel/query-selector.sky
diff --git a/sky/tests/lowlevel/query-selector.sky b/sky/tests/lowlevel/query-selector.sky
index dd7d2564e89879448d44f7cf46a203c1b38e544f..42efb6ea99736609c30bfaf7ef7fe1fde3e9bc0a 100644
--- a/sky/tests/lowlevel/query-selector.sky
+++ b/sky/tests/lowlevel/query-selector.sky
@@ -8,10 +8,10 @@
<tag-name-3 class="class7" id="tag1"></tag-name-3>
<tag-name-3 class="class7" id="tag2"></tag-name-3>
<span class="class2">
- <span class="class5" id="id5"></span>
+ <span class="class5" id="id5" testAttr></span>
</span>
<div id="id5"></div>
- <tag-name-6 class="class6" id="id6">
+ <tag-name-6 class="class6" id="id6" testAttr="the value">
<tag-name-3 class="class7" id="tag2"></tag-name-3>
</tag-name-6>
</div>
@@ -57,6 +57,17 @@ describe("querySelector", function() {
assert.equal(queryAll("tag-name-3.class7")[0].id, "tag1");
assert.equal(queryAll("tag-name-3.class7")[1].id, "tag2");
});
+ it("should find all elements by attribute presence selector", function() {
+ assert.ok(queryAll("[testAttr]"));
+ assert.equal(queryAll("[testAttr]").length, 2);
+ assert.equal(queryAll("[testAttr]")[0].id, "id5");
+ assert.equal(queryAll("[testAttr]")[1].id, "id6");
+ });
+ it("should find all elements by attribute value selector", function() {
+ assert.ok(queryAll("[testAttr='the value']"));
+ assert.equal(queryAll("[testAttr='the value']").length, 1);
+ assert.equal(queryAll("[testAttr='the value']")[0].id, "id6");
+ });
});
</script>
</html>
« no previous file with comments | « sky/engine/core/css/parser/CSSGrammar.y ('k') | sky/tests/lowlevel/query-selector-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698