Closed Bug 1424595 Opened 7 years ago Closed 7 years ago

Ignore Promise rejection for denied access in browser/base/content/test/permissions/browser_temporary_permissions_expiry.js

Categories

(Firefox :: Site Identity, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 59
Tracking Status
firefox59 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

browser/base/content/test/permissions/browser_temporary_permissions_expiry.js clicks Reject button for permission dialog, and that results in Promise rejection,
and the testcase may fail if the rejection is caught by the test harness.
after bug 1416446, on non-e10s, the case happens.

we should just ignore the promise rejection.
I meant Deny button.
This fixed bug 1416446 comment #23 failure.
> 13 INFO TEST-UNEXPECTED-FAIL | browser/base/content/test/permissions/browser_temporary_permissions_expiry.js | A promise chain failed to handle a rejection: The request is not allowed by the user agent or the platform in the current context. - stack: denyGUMRequest@resource:///modules/ContentWebRTC.jsm:238:3
> receiveMessage@resource:///modules/ContentWebRTC.jsm:81:9
> ContentWebRTCShim@chrome://browser/content/content.js:686:36
> Rejection date: Sun Dec 10 2017 20:03:01 GMT+0900 (JST) - false == true - JS frame :: resource://testing-common/PromiseTestUtils.jsm :: assertNoUncaughtRejections :: line 253
> Stack trace:
>     resource://testing-common/PromiseTestUtils.jsm:assertNoUncaughtRejections:253
>     chrome://mochikit/content/browser-test.js:Tester_execTest/<:1087
>     Tester_execTest@chrome://mochikit/content/browser-test.js:1056:9
>     Tester.prototype.nextTest</<@chrome://mochikit/content/browser-test.js:956:9
>     SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:795:59

Added PromiseTestUtils.whitelistRejectionsGlobally for the permission denied promise rejection.
it's caught by test harness only on non-e10s, so I used whitelistRejectionsGlobally instead of expectUncaughtRejection.
Attachment #8936124 - Flags: review?(jhofmann)
Comment on attachment 8936124 [details] [diff] [review]
Ignore Promise rejection for denied access in browser/base/content/test/permissions/browser_temporary_permissions_expiry.js

Review of attachment 8936124 [details] [diff] [review]:
-----------------------------------------------------------------

I'm a little concerned about whitelisting all "request is not allowed" exceptions for the permissions test folder, but it seems this is the best way to do it without putting in a big effort.

Thank you!
Attachment #8936124 - Flags: review?(jhofmann) → review+
Component: General → Site Identity and Permission Panels
Priority: -- → P1
https://hg.mozilla.org/integration/mozilla-inbound/rev/44524912f6f5ded1f4649857ecffcc3e8ee51484
Bug 1424595 - Ignore Promise rejection for denied access in browser/base/content/test/permissions/browser_temporary_permissions_expiry.js r=johannh
https://hg.mozilla.org/mozilla-central/rev/44524912f6f5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: