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

Side by Side Diff: pkg/polymer/test/event_path_declarative_test.dart

Issue 151893003: Use a transformer to initialize custom elements and call initMethod. This is the (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « pkg/polymer/test/event_handlers_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/polymer/test/event_handlers_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698