| 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 // This is ported from event-path-declarative-test.dart in polymer/test/html/. | 5 // This is ported from event-path-declarative-test.dart in polymer/test/html/. |
| 6 // While the original test was intended to test event.path support, we changed | 6 // While the original test was intended to test event.path support, we changed |
| 7 // the test structure just to check that the event was handled in the expected | 7 // the test structure just to check that the event was handled in the expected |
| 8 // order. | 8 // order. |
| 9 library polymer.test.event_path_declarative_test; | 9 library polymer.test.event_path_declarative_test; |
| 10 | 10 |
| 11 import 'dart:async'; | 11 import 'dart:async'; |
| 12 import 'dart:collection'; | 12 import 'dart:collection'; |
| 13 import 'dart:html'; | 13 import 'dart:html'; |
| 14 | 14 |
| 15 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
| 16 import 'package:unittest/html_config.dart'; | 16 import 'package:unittest/html_config.dart'; |
| 17 import 'package:polymer/polymer.dart'; | 17 import 'package:polymer/polymer.dart'; |
| 18 import 'package:template_binding/template_binding.dart'; | 18 import 'package:template_binding/template_binding.dart'; |
| 19 import 'package:polymer/platform.dart' as Platform; | |
| 20 | 19 |
| 21 var _observedEvents = []; | 20 var _observedEvents = []; |
| 22 var _testFired; | 21 var _testFired; |
| 23 | 22 |
| 24 main() => initPolymer(); | 23 main() => initPolymer(); |
| 25 | 24 |
| 26 @reflectable | 25 @reflectable |
| 27 class XZug extends PolymerElement { | 26 class XZug extends PolymerElement { |
| 28 | 27 |
| 29 XZug.created() : super.created(); | 28 XZug.created() : super.created(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 var expectedPath = [ xBarContent, xBarDiv, xFooContent, | 111 var expectedPath = [ xBarContent, xBarDiv, xFooContent, |
| 113 xZugContent, xZugDiv, xZug, xFooDiv, xFoo, xBar]; | 112 xZugContent, xZugDiv, xZug, xFooDiv, xFoo, xBar]; |
| 114 debugName(e) => '${e.localName}#${e.id}'; | 113 debugName(e) => '${e.localName}#${e.id}'; |
| 115 expect(_observedEvents, expectedPath, reason: | 114 expect(_observedEvents, expectedPath, reason: |
| 116 '<br>\nexpected: ${expectedPath.map(debugName).join(',')}' | 115 '<br>\nexpected: ${expectedPath.map(debugName).join(',')}' |
| 117 '<br>\nactual: ${_observedEvents.map(debugName).join(',')}' | 116 '<br>\nactual: ${_observedEvents.map(debugName).join(',')}' |
| 118 ); | 117 ); |
| 119 }); | 118 }); |
| 120 }); | 119 }); |
| 121 } | 120 } |
| OLD | NEW |