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

Side by Side Diff: tests/html/custom/attribute_changed_callback_test.dart

Issue 1060103002: Fix attribute_changed_callback_test to expect event delivery either synchronously or asynchronously (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « no previous file | tests/html/html.status » ('j') | tests/html/html.status » ('J')
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 library attribute_changed_callback_test; 5 library attribute_changed_callback_test;
6 6
7 import 'dart:async';
7 import 'dart:html'; 8 import 'dart:html';
8 import 'dart:js' as js; 9 import 'dart:js' as js;
9 import 'package:unittest/html_individual_config.dart'; 10 import 'package:unittest/html_individual_config.dart';
10 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
11 import '../utils.dart'; 12 import '../utils.dart';
12 13
13 class A extends HtmlElement { 14 class A extends HtmlElement {
14 static final tag = 'x-a'; 15 static final tag = 'x-a';
15 factory A() => new Element.tag(tag); 16 factory A() => new Element.tag(tag);
16 A.created() : super.created(); 17 A.created() : super.created();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 84
84 b.attributes.remove('data-v'); 85 b.attributes.remove('data-v');
85 expect(B.invocations, ['data-v: x => null']); 86 expect(B.invocations, ['data-v: x => null']);
86 }); 87 });
87 88
88 test('add, change ID', () { 89 test('add, change ID', () {
89 B.invocations = []; 90 B.invocations = [];
90 91
91 var b = new B(); 92 var b = new B();
92 b.id = 'x'; 93 b.id = 'x';
93 expect(B.invocations, ['created', 'id: null => x']); 94
94 95 return new Future.delayed(new Duration(milliseconds: 1))
95 B.invocations = []; 96 .then((_) => expect(B.invocations, ['created', 'id: null => x']))
96 b.attributes.remove('id'); 97 .then((_) {
97 expect(B.invocations, ['id: x => null']); 98 B.invocations = [];
99 b.attributes.remove('id');
100 })
101 .then((_) => new Future.delayed(new Duration(milliseconds: 1)))
102 .then((_) => expect(B.invocations, ['id: x => null']));
98 }); 103 });
99 }); 104 });
100 105
101 group('unsupported_on_polyfill', () { 106 group('unsupported_on_polyfill', () {
102 107
103 // If these tests start passing, don't remove the status suppression. Move 108 // If these tests start passing, don't remove the status suppression. Move
104 // the tests to the fullYy_supported group. 109 // the tests to the fullYy_supported group.
105 110
106 test('add, change classes', () { 111 test('add, change classes', () {
107 var b = new B(); 112 var b = new B();
108 113
109 B.invocations = []; 114 B.invocations = [];
110 b.classes.toggle('u'); 115 b.classes.toggle('u');
111 expect(B.invocations, ['class: null => u']); 116 expect(B.invocations, ['class: null => u']);
112 }); 117 });
113 }); 118 });
114 } 119 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | tests/html/html.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698