| 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 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 divTestEventHandler(e, detail, sender) { | 75 divTestEventHandler(e, detail, sender) { |
| 76 _observedEvents.add(sender); | 76 _observedEvents.add(sender); |
| 77 } | 77 } |
| 78 | 78 |
| 79 testEventHandler(e, detail, sender) { | 79 testEventHandler(e, detail, sender) { |
| 80 _observedEvents.add(sender); | 80 _observedEvents.add(sender); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 @initMethod _init() { | 84 @initMethod init() { |
| 85 useHtmlConfiguration(); | 85 useHtmlConfiguration(); |
| 86 // TODO(sigmund): switch back to use @CustomTag. We seem to be running into a | 86 // TODO(sigmund): switch back to use @CustomTag. We seem to be running into a |
| 87 // problem where using @CustomTag doesn't guarantee that we register the tags | 87 // problem where using @CustomTag doesn't guarantee that we register the tags |
| 88 // in the following order (the query from mirrors is non deterministic). | 88 // in the following order (the query from mirrors is non deterministic). |
| 89 // We shouldn't care about registration order though. See dartbug.com/14459 | 89 // We shouldn't care about registration order though. See dartbug.com/14459 |
| 90 Polymer.register('x-zug', XZug); | 90 Polymer.register('x-zug', XZug); |
| 91 Polymer.register('x-foo', XFoo); | 91 Polymer.register('x-foo', XFoo); |
| 92 Polymer.register('x-bar', XBar); | 92 Polymer.register('x-bar', XBar); |
| 93 | 93 |
| 94 _testFired = new Completer(); | 94 _testFired = new Completer(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 111 var expectedPath = [ xBarContent, xBarDiv, xFooContent, | 111 var expectedPath = [ xBarContent, xBarDiv, xFooContent, |
| 112 xZugContent, xZugDiv, xZug, xFooDiv, xFoo, xBar]; | 112 xZugContent, xZugDiv, xZug, xFooDiv, xFoo, xBar]; |
| 113 debugName(e) => '${e.localName}#${e.id}'; | 113 debugName(e) => '${e.localName}#${e.id}'; |
| 114 expect(_observedEvents, expectedPath, reason: | 114 expect(_observedEvents, expectedPath, reason: |
| 115 '<br>\nexpected: ${expectedPath.map(debugName).join(',')}' | 115 '<br>\nexpected: ${expectedPath.map(debugName).join(',')}' |
| 116 '<br>\nactual: ${_observedEvents.map(debugName).join(',')}' | 116 '<br>\nactual: ${_observedEvents.map(debugName).join(',')}' |
| 117 ); | 117 ); |
| 118 }); | 118 }); |
| 119 }); | 119 }); |
| 120 } | 120 } |
| OLD | NEW |