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

Side by Side Diff: client/tests/client/samples/total/total_test_lib.dart

Issue 9148015: Example showing alternate async measurement solution (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final version Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
1 totalTests() { 1 totalTests() {
2 test('DateUtils', () { 2 test('DateUtils', () {
3 _isDate('1/1'); 3 _isDate('1/1');
4 _isDate('12/1'); 4 _isDate('12/1');
5 _isDate('11/31'); 5 _isDate('11/31');
6 _isDate('01/1'); 6 _isDate('01/1');
7 _isDate('1/01'); 7 _isDate('1/01');
8 _isDate('01/01'); 8 _isDate('01/01');
9 _isDate('1-1'); 9 _isDate('1-1');
10 _isDate('12-1'); 10 _isDate('12-1');
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 HtmlUtils.quoteHtml("<<Hello<World<")); 50 HtmlUtils.quoteHtml("<<Hello<World<"));
51 Expect.equals("&lt;&lt;Hello&lt;W&lt;orld&lt;", 51 Expect.equals("&lt;&lt;Hello&lt;W&lt;orld&lt;",
52 HtmlUtils.quoteHtml("<<Hello<W<orld<")); 52 HtmlUtils.quoteHtml("<<Hello<W<orld<"));
53 53
54 Document doc = window.document; 54 Document doc = window.document;
55 Element body = doc.body; 55 Element body = doc.body;
56 DivElement div = new Element.tag('div'); 56 DivElement div = new Element.tag('div');
57 body.nodes.add(div); 57 body.nodes.add(div);
58 58
59 HtmlUtils.setIntegerProperty(div, "left", 100, "px"); 59 HtmlUtils.setIntegerProperty(div, "left", 100, "px");
60 div.computedStyle.then((CSSStyleDeclaration computedStyle) { 60 window.requestMeasurementFrame(() {
61 String valueAsString = computedStyle.getPropertyValue("left"); 61 String valueAsString = div.computedStyle.left;
62 // FIXME: Test fails, with valueAsString == "auto". However, 62 // FIXME: Test fails, with valueAsString == "auto". However,
63 // setIntegerProperty works when tested in practice, so there is 63 // setIntegerProperty works when tested in practice, so there is
64 // something wrong with recovering the value. 64 // something wrong with recovering the value.
65 // Expect.equals("100", valueAsString); 65 // Expect.equals("100", valueAsString);
66 66
67 div.remove(); 67 div.remove();
68 callbackDone(); 68 callbackDone();
69 }); 69 });
70 }); 70 });
71 71
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 Expect.isFalse(DateUtils.isDate(date), "DateUtils.isDate(${date})"); 454 Expect.isFalse(DateUtils.isDate(date), "DateUtils.isDate(${date})");
455 } 455 }
456 456
457 _assertNumeric(String s) { 457 _assertNumeric(String s) {
458 Expect.isTrue(StringUtils.isNumeric(s), 'StringUtils.isNumeric("{$s}")'); 458 Expect.isTrue(StringUtils.isNumeric(s), 'StringUtils.isNumeric("{$s}")');
459 } 459 }
460 460
461 _assertNonNumeric(String s) { 461 _assertNonNumeric(String s) {
462 Expect.isFalse(StringUtils.isNumeric(s), '!StringUtils.isNumeric("${s}")'); 462 Expect.isFalse(StringUtils.isNumeric(s), '!StringUtils.isNumeric("${s}")');
463 } 463 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698