[Media Router] presentationRequest.start() should reject with NotFoundError when there are no compatable presentation displays for presentationUrl |
||||||
Issue descriptionWhen start() is called on a PresentationRequest for which there are no compatible displays, Media Router falls back to mirroring mode instead of rejecting the promise with a NotFoundError DOMException as required by the Presentation API specs (item 10, https://w3c.github.io/presentation-api/#h-starting-a-presentation). Instead, the promise is rejected with an AbortError DOMException when the MR dialog closes, regardless of whether the page is mirrored. Reproduce in Chrome with MR enabled: new PresentationRequest('http://google.com/cast/#__castAppId__=invalid-app-id').start(); Expected behavior: - MR dialog does not appear since there are no compatible presentation display for presentationUrl - Promise rejects with "DOMException: No screens found." Current behavior: - MR dialog appears, showing devices capable of mirroring page - Promise rejects with "DOMException: Dialog closed." when MR dialog even if the page is mirrored
,
Jun 18 2016
,
Jun 22 2016
Mark should the spec change here? Having different things show up depending on where the dialog was opened from does not seem desirable.
,
Jun 27 2016
I think the spec is correct, the implementation is buggy. We need to fix the Promise rejection to match spec. Whether we want to offer the dialog or not in this case (the page gives us a URL we can't present) is our UX choice.
,
Jun 30 2016
,
Jun 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c commit 21d9a27daad3d0f6c3a9ad15818a099c728a3b3c Author: btolsch <btolsch@chromium.org> Date: Thu Jun 30 23:31:10 2016 [Media Router] Return NotFoundError on dialog exit if appropriate The MR dialog will always be opened when starting a PresentationRequest, even if there are no sinks that support the presentation url. The default cast mode will then be some form of mirroring. This means that whether the user selects a device in the dialog or not, the promise from start() will be rejected with an AbortError. Instead, a NotFoundError should be used if there were no devices which supported the presentation url. BUG= 621161 Review-Url: https://codereview.chromium.org/2108973002 Cr-Commit-Position: refs/heads/master@{#403336} [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/browser/ui/webui/media_router/media_router_ui.cc [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/browser/ui/webui/media_router/media_router_ui.h [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/test/media_router/BUILD.gn [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/test/media_router/media_router_integration_browsertest.cc [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/test/media_router/media_router_tests.gypi [modify] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/test/media_router/resources/README.md [add] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/test/media_router/resources/no_sinks.json [add] https://crrev.com/21d9a27daad3d0f6c3a9ad15818a099c728a3b3c/chrome/test/media_router/resources/no_supported_sinks.json
,
Jul 1 2016
,
Jul 7 2016
jonlau@, could you please let us know the manual repro steps if test team can verify this fix? Thank you!
,
Jul 7 2016
@manoranjanr, steps for manual repro as above.
1. Open any page and execute in console:
new PresentationRequest('http://google.com/cast/#__castAppId__=invalid-app-id').start();
2. Select any Chromecast device from the MR dialog.
3. The promise from start() should not be rejected with an AbortError (DOMException: Dialog closed).
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by jonlau@google.com
, Jun 17 2016