"Harness status: ERROR" when running "oninstall-script-error.https.html" test

RESOLVED FIXED in Firefox 45

Status

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: noemi, Assigned: bkelly)

Tracking

Trunk
mozilla45
Points:
---

Firefox Tracking Flags

(firefox42 affected, firefox45 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Test run such as |./mach web-platform-tests _mozilla/service-workers/service-worker/oninstall-script-error.https.html|

Actual Result:
Harness status: Error
Error: error at level 1

Found 5 tests
3 Pass
2 Fail
Details:
Pass	install handler throws an error	
Pass	install handler throws an error, error handler does not cancel	
Pass	install handler dispatches an event that throws an error	
Fail	install handler throws an error that is cancelled	
assert_equals: The worker was installed expected true but got false
make_test/</<@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:26:1
Promise*make_test/<@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:21:14
Test.prototype.step@https://web-platform.test:8443/resources/testharness.js:1371:20
promise_test/tests.promise_tests<@https://web-platform.test:8443/resources/testharness.js:527:36
Promise*promise_test@https://web-platform.test:8443/resources/testharness.js:526:31
make_test@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:19:1
@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:59:5
@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:32:1

Fail	install handler throws an error and prevents default
assert_equals: The worker was installed expected true but got false
make_test/</<@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:26:1
Promise*make_test/<@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:21:14
Test.prototype.step@https://web-platform.test:8443/resources/testharness.js:1371:20
promise_test/tests.promise_tests<@https://web-platform.test:8443/resources/testharness.js:527:36
Promise*promise_test@https://web-platform.test:8443/resources/testharness.js:526:31
make_test@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:19:1
@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:59:5
@https://web-platform.test:8443/_mozilla/service-workers/service-worker/oninstall-script-error.https.html:32:1

Traces: https://pastebin.mozilla.org/8838614
Olli,

I would like to detect when a dispatched event raised an error in the handler. For that I am using the mExceptionHasBeenRisen flag. Unfortunately, in WebIDL bindings we do actual error handling in the CallSetup destructor. This means that the event dispatch itself (HandleEventSubType) returns false even if the JS Error Reporter on workers fired "error" events which were then canceled by script. So the mExceptionHasBeenRisen is set to true even if the script canceled error dispatch. Is there some way to deal with this?

Otherwise I'll have to use a member variable to track this.
Flags: needinfo?(bugs)
(In reply to Nikhil Marathe [:nsm] (please needinfo?) from comment #1)
> Olli,
> 
> I would like to detect when a dispatched event raised an error in the
> handler.
So add event listener for "error"? Though, can be a bit tricky if there is some nested event dispatching
happening.

> For that I am using the mExceptionHasBeenRisen flag.


> Unfortunately,
> in WebIDL bindings we do actual error handling in the CallSetup destructor.
> This means that the event dispatch itself (HandleEventSubType) returns false
Don't understand what this means. HandleEventSubType doesn't return bool.
I guess you mean 'return failure'

> even if the JS Error Reporter on workers fired "error" events which were
> then canceled by script. So the mExceptionHasBeenRisen is set to true even
> if the script canceled error dispatch.
> Is there some way to deal with this?
I can't think of any easy way.
Flags: needinfo?(bugs)

Updated

3 years ago
Blocks: 1189023
No longer blocks: 1180638
(Assignee)

Comment 3

3 years ago
Created attachment 8684588 [details] [diff] [review]
Fix wpt oninstall-script-error.https.html. r=baku

The test was wrong.  I verified in a spec issue that our behavior is correct.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Attachment #8684588 - Flags: review?(amarchesini)
Attachment #8684588 - Flags: review?(amarchesini) → review+

Comment 5

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f92a40cc63ce
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox45: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.