Index: tests/html/history_test.dart |
diff --git a/tests/html/history_test.dart b/tests/html/history_test.dart |
index 6f4eb3a960a7cd62ea8527b9417c7b11ffb70444..f2c7c1286cf10f75356c5dfccd508fe878c8ebc6 100644 |
--- a/tests/html/history_test.dart |
+++ b/tests/html/history_test.dart |
@@ -3,16 +3,6 @@ import '../../pkg/unittest/lib/unittest.dart'; |
import '../../pkg/unittest/lib/html_individual_config.dart'; |
import 'dart:html'; |
-/// Waits for a callback once, then removes the event handler. |
-void expectAsync1Once(EventListenerList list, void callback(arg)) { |
- var fn = null; |
- fn = expectAsync1((arg) { |
- list.remove(fn); |
- callback(arg); |
- }); |
- list.add(fn); |
-} |
- |
main() { |
useHtmlIndividualConfiguration(); |
@@ -53,10 +43,10 @@ main() { |
// Need to wait a frame or two to let the pushState events occur. |
window.setTimeout(expectAsync0(() { |
- expectAsync1Once(window.on.popState, (_) { |
+ window.onPopState.first.then(expectAsync1((_){ |
expect(window.history.length, length); |
expect(window.location.href.endsWith('dummy1'), isTrue); |
- }); |
+ })); |
window.history.back(); |
}), 100); |