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

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

Issue 307793002: update polymer, nodebind, and templatebinding (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/pubspec.yaml ('k') | pkg/polymer/test/auto_binding_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'dart:async';
6 import 'dart:html';
7 import 'package:polymer/auto_binding.dart';
8 import 'package:polymer/polymer.dart';
9 import 'package:unittest/unittest.dart';
10 import 'package:unittest/html_config.dart';
11
12 class TestModel {
13 var greeting = 'Hi';
14 eventAction(e) {
15 e.detail.add('handled');
16 }
17 }
18
19 main() => initPolymer().run(() {
20 useHtmlConfiguration();
21
22 setUp(() => Polymer.onReady);
23
24 test('elements upgraded', () {
25 AutoBindingElement template = document.getElementById('one');
26 template.model = new TestModel();
27
28 var completer = new Completer();
29 var events = 0;
30 window.addEventListener('template-bound', (e) {
31 events++;
32 if (e.target.id == 'one') {
33 expect(e.target, template);
34
35 var t = template;
36 var h = t.$['h'];
37 expect(h.text, t.model.greeting, reason: 'binding applied');
38 var ce = t.fire('tap', onNode: h, detail: []);
39 expect(ce.detail, ['handled'], reason: 'element event handler fired');
40 }
41
42 if (events == 2) completer.complete();
43 });
44
45 return completer.future;
46 });
47 });
OLDNEW
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | pkg/polymer/test/auto_binding_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698