Chromium Code Reviews| 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); |
| }); |
| }); |
| } |