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

Unified Diff: tests/html/history_test.dart

Issue 12040059: Converting tests over to using event streams. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: 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);

Powered by Google App Engine
This is Rietveld 408576698