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

Side by Side Diff: test/iron_a11y_announcer_test.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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
« no previous file with comments | « test/fixtures/x_list.html ('k') | test/iron_a11y_keys_behavior_test.dart » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 @TestOn('browser') 4 @TestOn('browser')
5 library polymer_elements.test.iron_a11y_announcer_test; 5 library polymer_elements.test.iron_a11y_announcer_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:js';
9 import 'package:polymer_elements/iron_a11y_announcer.dart'; 10 import 'package:polymer_elements/iron_a11y_announcer.dart';
10 import 'package:web_components/web_components.dart'; 11 import 'package:web_components/web_components.dart';
11 import 'package:test/test.dart'; 12 import 'package:test/test.dart';
12 13
13 main() async { 14 main() async {
14 await initWebComponents(); 15 await initWebComponents();
15 16
16 group('<iron-a11y-announcer', () { 17 group('<iron-a11y-announcer', () {
17 IronA11yAnnouncer announcer; 18 IronA11yAnnouncer announcer;
18 19
19 setUp(() { 20 setUp(() {
20 announcer = new IronA11yAnnouncer(); 21 announcer = new IronA11yAnnouncer();
21 }); 22 });
22 23
23 test('announces when there is an iron-announce event', () async { 24 test('announces when there is an iron-announce event', () async {
24 var event = new CustomEvent('iron-announce', 25 announcer.fire('iron-announce',
25 canBubble: true, detail: {'text': 'foo'}); 26 detail: {'text': 'foo'}, node: document.body);
26 document.body.dispatchEvent(event);
27 // Text isn't set for 100ms 27 // Text isn't set for 100ms
28 await new Future.delayed(new Duration(milliseconds: 200), () {}); 28 await new Future.delayed(new Duration(milliseconds: 200), () {});
29 expect(announcer.jsElement['_text'], 'foo'); 29 expect(announcer.jsElement['_text'], 'foo');
30 }); 30 });
31 }); 31 });
32 } 32 }
OLDNEW
« no previous file with comments | « test/fixtures/x_list.html ('k') | test/iron_a11y_keys_behavior_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698