Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'package:unittest/html_config.dart'; | 7 import 'package:unittest/html_config.dart'; |
| 8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 | 9 |
| 10 @CustomTag('my-element') | 10 @CustomTag('my-element') |
|
Siggi Cherem (dart-lang)
2013/10/14 16:58:00
missing 'type'?
| |
| 11 class MyElement extends PolymerElement { | 11 class MyElement extends PolymerElement { |
| 12 MyElement.created() : super.created(); | |
| 13 | |
| 12 @published double volume; | 14 @published double volume; |
| 13 @published int factor; | 15 @published int factor; |
| 14 @published bool crankIt; | 16 @published bool crankIt; |
| 15 @published String msg; | 17 @published String msg; |
| 16 @published DateTime time; | 18 @published DateTime time; |
| 17 @published Object json; | 19 @published Object json; |
| 18 } | 20 } |
| 19 | 21 |
| 20 main() { | 22 main() { |
| 21 useHtmlConfiguration(); | 23 useHtmlConfiguration(); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 36 // Collapse adjacent whitespace like a browser would: | 38 // Collapse adjacent whitespace like a browser would: |
| 37 text = text.replaceAll('\n', ' ').replaceAll(new RegExp(r'\s+'), ' '); | 39 text = text.replaceAll('\n', ' ').replaceAll(new RegExp(r'\s+'), ' '); |
| 38 | 40 |
| 39 // Note: using "${33.0}" because the toString differs in JS vs Dart VM. | 41 // Note: using "${33.0}" because the toString differs in JS vs Dart VM. |
| 40 expect(text, " Yo! The volume is ${33.0} !! The time is " | 42 expect(text, " Yo! The volume is ${33.0} !! The time is " |
| 41 "2013-08-08 18:34:00.000Z and here's some JSON: " | 43 "2013-08-08 18:34:00.000Z and here's some JSON: " |
| 42 "{here: is, some: json, x: 123} ", | 44 "{here: is, some: json, x: 123} ", |
| 43 reason: 'text should match expected HTML template'); | 45 reason: 'text should match expected HTML template'); |
| 44 }); | 46 }); |
| 45 } | 47 } |
| OLD | NEW |