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

Unified Diff: test/iron_collapse_test.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: update pubspec/changelog Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: test/iron_collapse_test.dart
diff --git a/test/iron_collapse_test.dart b/test/iron_collapse_test.dart
index 54bd4019eb02b70afef2fcf380ddea84ded36f91..255f7affa71f5d7a52691eb6c33d8e368bc649da 100644
--- a/test/iron_collapse_test.dart
+++ b/test/iron_collapse_test.dart
@@ -60,7 +60,7 @@ main() async {
group('horizontal', () {
IronCollapse collapse;
- var delay = new Duration(milliseconds: 500);
+ var delay = 500;
var width;
setUp(() {
@@ -75,31 +75,28 @@ main() async {
expect(collapse.horizontal, true);
});
- test('default opened width', () {
- return new Future.delayed(delay, () {
- // store height
- width = collapse.getComputedStyle().width;
- // verify height not 0px
- expect(width, isNot('0px'));
- });
+ test('default opened width', () async {
+ await wait(delay);
Siggi Cherem (dart-lang) 2015/10/28 22:35:16 much better :)
jakemac 2015/10/29 16:07:29 Acknowledged.
+ // store height
+ width = collapse.getComputedStyle().width;
+ // verify height not 0px
+ expect(width, isNot('0px'));
});
- test('set opened to false', () {
+ test('set opened to false', () async {
collapse.opened = false;
- return new Future.delayed(delay, () {
- var w = collapse.getComputedStyle().width;
- // verify height is 0px
- expect(w, '0px');
- });
+ await wait(delay);
+ var w = collapse.getComputedStyle().width;
+ // verify height is 0px
+ expect(w, '0px');
});
- test('set opened to true', () {
+ test('set opened to true', () async {
collapse.opened = true;
- return new Future.delayed(delay, () {
- var w = collapse.getComputedStyle().width;
- // verify height
- expect(w, width);
- });
+ await wait(delay);
+ var w = collapse.getComputedStyle().width;
+ // verify height
+ expect(w, width);
});
});
}

Powered by Google App Engine
This is Rietveld 408576698