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

Side by Side Diff: sky/tests/lowlevel/attribute-collection.sky

Issue 1212163009: Port remaining Sky tests to the new world (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: add Created 5 years, 5 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 <html>
2 <script>
3 import "../resources/third_party/unittest/unittest.dart";
4 import "../resources/unit.dart";
5
6 import "dart:sky";
7
8 void main() {
9 initUnit();
10
11 var div;
12 setUp(() {
13 div = document.createElement("div");
14 });
15
16 test("should get by index", () {
17 div.setAttribute("attr0", "value0");
18 div.setAttribute("attr1", "value1");
19 var attrs = div.getAttributes();
20 expect(attrs.length, equals(2));
21 expect(attrs[0].name, equals("attr0"));
22 expect(attrs[0].value, equals("value0"));
23 expect(attrs[1].name, equals("attr1"));
24 expect(attrs[1].value, equals("value1"));
25 });
26 test("should set by name", () {
27 div.setAttribute("attrName", "value0");
28 expect(div.getAttribute("attrName"), equals("value0"));
29 expect(div.getAttributes()[0].name, equals("attrName"));
30 expect(div.getAttributes()[0].value, equals("value0"));
31 div.setAttribute("attrName", "new value");
32 expect(div.getAttribute("attrName"), equals("new value"));
33 expect(div.getAttributes()[0].name, equals("attrName"));
34 expect(div.getAttributes()[0].value, equals("new value"));
35 });
36 test("should be case sensitive", () {
37 div.setAttribute("attrName", "value0");
38 expect(div.getAttribute("attrname"), isNull);
39 expect(div.getAttribute("attrName"), equals("value0"));
40 });
41 test("should not live update", () {
42 div.setAttribute("attr0", "0");
43 div.setAttribute("attr1", "1");
44 div.setAttribute("attr2", "2");
45 var oldAttributes = div.getAttributes();
46 expect(oldAttributes.length, equals(3));
47 div.removeAttribute("attr1");
48 expect(oldAttributes.length, equals(3));
49 div.setAttribute("attr0", "value0");
50 div.setAttribute("attr2", "value2");
51 var newAttributes = div.getAttributes();
52 expect(newAttributes.length, equals(2));
53 expect(newAttributes[0].name, equals("attr0"));
54 expect(newAttributes[0].value, equals("value0"));
55 expect(newAttributes[1].name, equals("attr2"));
56 expect(newAttributes[1].value, equals("value2"));
57 expect(newAttributes, isNot(equals(oldAttributes)));
58 expect(oldAttributes[0].name, equals("attr0"));
59 expect(oldAttributes[0].value, equals("0"));
60 expect(oldAttributes[1].name, equals("attr1"));
61 expect(oldAttributes[1].value, equals("1"));
62 expect(oldAttributes[2].name, equals("attr2"));
63 expect(oldAttributes[2].value, equals("2"));
64 });
65 }
66 </script>
67 </html>
OLDNEW
« no previous file with comments | « sky/tests/fast/images/resources/ycbcr-with-no-color-profile.jpg ('k') | sky/tests/lowlevel/attribute-collection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698