Attempted fix for Firefox flakiness.

BUG=http://dartbug.com/19042
R=ricow@google.com

Review URL: https://codereview.chromium.org//302813002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36733 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
ahe@google.com 2014-05-28 09:05:41 +00:00
parent 0e172b7de7
commit dad61e5ff2
2 changed files with 11 additions and 6 deletions

View file

@ -391,7 +391,6 @@ websql_test/supported: Fail
messageevent_test: RuntimeError # Issue 15651
serialized_script_value_test: RuntimeError # Issue 15651
client_rect_test: Fail # Issue 16890
worker_test/functional: Pass, RuntimeError # http://dartbug.com/19042
[ $runtime == ff ]
xhr_test/xhr: Pass, Fail # Issue 11602

View file

@ -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) {