Closed Bug 1288600 Opened 7 years ago Closed 7 years ago
API] No available device, return Not Found Error exception
According to https://www.w3.org/TR/presentation-api/#starting-a-presentation 10. If either of the following is true: 1. The list of available presentation displays is empty and will remain so before the request for user permission is completed. ... Then run the following steps: 1. Reject P with a NotFoundError exception. 2. Abort all remaining steps. If there is no device available for presentation display, WebAPI should return NotFoundError.
@Teri can you upload or link your test case to this bug?
STR: 1. Make sure no device is in the environment 2. Try to launch a presentation Expected Behavior: Return NotFoundError and abort Actual Behavior: >>start error: AbortError: The operation was aborted.
Ok, this line of code should be responsible: https://dxr.mozilla.org/mozilla-central/source/dom/presentation/PresentationService.cpp#178 This part of spec is changed after our first implementation. In order to fulfill the step #10 and #11 of the start session procedure, we'll need PresentationDevicePrompt to provide error cause while canceling the prompt request.
Assignee: nobody → schien
1. reject promise with NotFoundError while no available device 2. reject promise with NotAllowedError while canceled by user 3. expose NS_ERROR_DOM_NOT_FOUND_ERR and NS_ERROR_DOM_NOT_ALLOWED_ERR in Components.results.
Attachment #8778780 - Flags: review?(bugs)
Comment on attachment 8778780 [details] [diff] [review] not-found-error-while-no-device.patch >+ >+/* Codes related to Presentation API */ >+XPC_MSG_DEF(NS_ERROR_DOM_NOT_FOUND_ERR , "The object can not be found here.") >+XPC_MSG_DEF(NS_ERROR_DOM_NOT_ALLOWED_ERR , "The request is not allowed.") Not really related to presentation API only, since they are defined in Webidl. So you can drop the comment, or mention webidl
Attachment #8778780 - Flags: review?(bugs) → review+
update according to review comment, carry r+.
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f30384ba6bc3 reject promise with NotFoundError while no device, and NotAllowedError while canceled by user. r=smaug.
Hi SC, Found that fennec shuts down when the request is canceled by user. Can you take a look?
(In reply to Teri Wen [:twen] from comment #10) > Hi SC, > > Found that fennec shuts down when the request is canceled by user. > Can you take a look? This fix is also included in the final version of patch that landed on m-c, do you want an update version of ENG build for verification?
Flags: needinfo?(schien) → needinfo?(twen)
Yes, please send me the build.
Verified fixed. No device. >>start error: NotFoundError: Node was not found User cancel request. >>start error: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.