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

Unified Diff: sky/tests/lowlevel/attribute-collection.sky

Issue 691893002: Add support for Element#getAttributes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: sky/tests/lowlevel/attribute-collection.sky
diff --git a/sky/tests/lowlevel/attribute-collection.sky b/sky/tests/lowlevel/attribute-collection.sky
index c6380e0d59c5acb6883cd2c640ac236c515c1f04..33817def468511ba56d1c8a6b9bba474010bf15f 100644
--- a/sky/tests/lowlevel/attribute-collection.sky
+++ b/sky/tests/lowlevel/attribute-collection.sky
@@ -24,6 +24,16 @@ describe("Attribute collection", function() {
assert.equal(div.attributes.attr0.value, "value0");
assert.equal(div.attributes.attr1.value, "value1");
});
+ it("should get all at once", function() {
+ div.setAttribute("attr0", "value0");
+ div.setAttribute("attr1", "value1");
+ var attrs = div.getAttributes();
+ assert.equal(attrs.length, 2);
+ assert.equal(attrs[0].name, "attr0");
+ assert.equal(attrs[0].value, "value0");
+ assert.equal(attrs[1].name, "attr1");
+ assert.equal(attrs[1].value, "value1");
+ });
it("should set by name", function() {
div.setAttribute("attrName", "value0");
div.attributes.attrName.value = "new value";

Powered by Google App Engine
This is Rietveld 408576698