New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 621161 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

[Media Router] presentationRequest.start() should reject with NotFoundError when there are no compatable presentation displays for presentationUrl

Project Member Reported by jonlau@google.com, Jun 17 2016

Issue description

When 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
 

Comment 1 by jonlau@google.com, Jun 17 2016

Components: Blink>PresentationAPI
Project Member

Comment 2 by sheriffbot@chromium.org, Jun 18 2016

Labels: Hotlist-Google

Comment 3 by sko...@chromium.org, Jun 22 2016

Cc: mfo...@chromium.org
Labels: Hotlist-Fixit
Status: Available (was: Untriaged)
Mark should the spec change here?  Having different things show up depending on where the dialog was opened from does not seem desirable. 

Comment 4 by mfo...@chromium.org, 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.

Owner: btolsch@chromium.org
Status: Started (was: Available)
Project Member

Comment 6 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
Labels: Needs-Feedback
jonlau@, could you please let us know the manual repro steps if test team can verify this fix?

Thank you!

Comment 9 by jonlau@google.com, 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