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

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

Issue 336013003: Version 1.5.0-dev.4.14 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
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
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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:html'; 6 import 'dart:html';
7 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 import 'package:unittest/html_config.dart'; 9 import 'package:unittest/html_config.dart';
10 10
11 @CustomTag('x-test') 11 @CustomTag('x-test')
12 class XTest extends PolymerElement { 12 class XTest extends PolymerElement {
13 @observable List list; 13 @observable List list;
14 14
15 final _enteredView = new Completer(); 15 final _attached = new Completer();
16 Future onTestDone; 16 Future onTestDone;
17 17
18 XTest.created() : super.created() { 18 XTest.created() : super.created() {
19 onTestDone = _enteredView.future.then(_runTest); 19 onTestDone = _attached.future.then(_runTest);
20 } 20 }
21 21
22 enteredView() { 22 attached() {
23 super.enteredView(); 23 super.attached();
24 _enteredView.complete(); 24 _attached.complete();
25 } 25 }
26 26
27 _runTest(_) { 27 _runTest(_) {
28 list = [ 28 list = [
29 {'name': 'foo'}, 29 {'name': 'foo'},
30 {'name': 'bar'} 30 {'name': 'bar'}
31 ]; 31 ];
32 return new Future(() { 32 return new Future(() {
33 // tickle SD polyfill 33 // tickle SD polyfill
34 offsetHeight; 34 offsetHeight;
(...skipping 17 matching lines...) Expand all
52 } 52 }
53 } 53 }
54 54
55 main() => initPolymer().run(() { 55 main() => initPolymer().run(() {
56 useHtmlConfiguration(); 56 useHtmlConfiguration();
57 57
58 setUp(() => Polymer.onReady); 58 setUp(() => Polymer.onReady);
59 59
60 test('inserted called', () => (querySelector('x-test') as XTest).onTestDone); 60 test('inserted called', () => (querySelector('x-test') as XTest).onTestDone);
61 }); 61 });
OLDNEW
« no previous file with comments | « dart/pkg/polymer/test/take_attributes_test.html ('k') | dart/pkg/polymer/test/template_distribute_dynamic_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698