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

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

Issue 302813002: Attempted fix for Firefox flakiness. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make sure onError is called. Created 6 years, 7 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
« no previous file with comments | « dart/tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/html/worker_test.dart
diff --git a/dart/tests/html/worker_test.dart b/dart/tests/html/worker_test.dart
index 896781fd6d14ca28d568cf068d93688dc623a3e8..dccb8b5d9da3ace512c3fd0314938890a6a6bc64 100644
--- a/dart/tests/html/worker_test.dart
+++ b/dart/tests/html/worker_test.dart
@@ -21,11 +21,17 @@ main() {
group('functional', () {
test('unsupported', () {
- var expectation = Worker.supported ? returnsNormally : throws;
-
- expect(() {
- new Worker('worker.js');
- }, expectation);
+ if (!Worker.supported) {
+ expect(() => new Worker('worker.js'), throws);
+ } else {
+ new Worker('worker.js').onError.first.then(expectAsync((e) {
+ // This event is expected, "worker.js" doesn't exist. But the event
+ // *sometimes* propagates to window.onerror in Firefox which causes
+ // this test to fail, so let's stop any further propagation:
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }));
+ }
});
if (!Worker.supported) {
« no previous file with comments | « dart/tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698