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

Side by Side Diff: test/iron_icon_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/iron_form_test.dart ('k') | test/iron_icon_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
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_icon_test; 5 library polymer_elements.test.iron_icon_test;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'dart:js'; 8 import 'dart:js';
9 import 'package:polymer_elements/iron_icon.dart'; 9 import 'package:polymer_elements/iron_icon.dart';
10 import 'package:polymer_elements/iron_iconset.dart'; 10 import 'package:polymer_elements/iron_iconset.dart';
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 test('can change its icon dynamically', () { 63 test('can change its icon dynamically', () {
64 var style = icon.style; 64 var style = icon.style;
65 expect( 65 expect(
66 style.backgroundPosition, contains(new RegExp(r'0(%|px) 0(%|px)'))); 66 style.backgroundPosition, contains(new RegExp(r'0(%|px) 0(%|px)')));
67 icon.icon = "example:blank"; 67 icon.icon = "example:blank";
68 expect( 68 expect(
69 style.backgroundPosition, contains(new RegExp(r'-24px 0(%|px)'))); 69 style.backgroundPosition, contains(new RegExp(r'-24px 0(%|px)')));
70 }); 70 });
71 }); 71 });
72
72 group('when no icon source is provided', () { 73 group('when no icon source is provided', () {
73 test('will politely wait for an icon source without throwing', () { 74 test('will politely wait for an icon source without throwing', () {
74 document.createElement('iron-icon'); 75 document.createElement('iron-icon');
75 fixture('WithoutAnIconSource'); 76 fixture('WithoutAnIconSource');
76 }); 77 });
77 }); 78 });
79
80 group('when loading async', () {
81 test('will get icon after iconset is added', () {
82 var icon = fixture('UsingAsyncIconset');
83 expect(hasIcon(icon), isFalse);
84
85 var done = window.on['iron-iconset-added'].first.then((_) {
86 expect(hasIcon(icon), isTrue,
87 reason: 'icon didn\'t load after iconset loaded');
88 });
89 fixture('AsyncIconset');
90
91 return done;
92 });
93 });
78 }); 94 });
79 } 95 }
OLDNEW
« no previous file with comments | « test/iron_form_test.dart ('k') | test/iron_icon_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698