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

Unified Diff: dart/tests/html/js_interop_1_test.dart

Issue 10916259: Enable wrapper-less browser tests on selenium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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: dart/tests/html/js_interop_1_test.dart
diff --git a/dart/tests/html/js_interop_1_test.dart b/dart/tests/html/js_interop_1_test.dart
index a2d0aba91bb56894edb2b9d6fca50fb55adda205..e63322d065e9a12d3300fa9f3d513ebf24d5b073 100644
--- a/dart/tests/html/js_interop_1_test.dart
+++ b/dart/tests/html/js_interop_1_test.dart
@@ -20,10 +20,14 @@ main() {
var callback;
test('js-to-dart-post-message', () {
- callback = expectAsync1((e) {
- Expect.equals('hello', e.data);
+ var onSuccess = expectAsync1((e) {
window.on.message.remove(callback);
});
+ callback = (e) {
+ if (e.data == 'hello') {
+ onSuccess(e);
+ }
+ };
window.on.message.add(callback);
injectSource("window.postMessage('hello', '*');");
});

Powered by Google App Engine
This is Rietveld 408576698