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

Unified Diff: tests/html/history_test.dart

Issue 12061002: Fixing type check error using Stream.take in dart2js checked mode. (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
« sdk/lib/async/stream_pipe.dart ('K') | « sdk/lib/async/stream_pipe.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/history_test.dart
diff --git a/tests/html/history_test.dart b/tests/html/history_test.dart
index bee3323b8866b1d7bc8748e877fb9b5fdea94e7c..87a6e83de61b4ae55c0aa8649749813967e6794a 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();
@@ -47,7 +37,7 @@ main() {
// Need to wait a frame or two to let the pushState events occur.
window.setTimeout(expectAsync0(() {
- expectAsync1Once(window.on.popState, (_) {
+ window.onPopState.take(1).listen((_) {
floitsch 2013/01/24 17:17:18 don't you need to wrap this function in an expectA
expect(window.history.length, length);
expect(window.location.href.endsWith('dummy1'), isTrue);
});
« sdk/lib/async/stream_pipe.dart ('K') | « sdk/lib/async/stream_pipe.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698