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

Issue 669213 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

[PresentationAPI] on start(), connectionavailable is fired before Promise is resolved

Project Member Reported by mfo...@chromium.org, Nov 28 2016

Issue description

Version:  57.0.2935.0 canary (64-bit)
OS: Mac OS X 10.10

What steps will reproduce the problem?
(1) Go to https://rawgit.com/mfoltzgoogle/web-platform-tests/single-presentation-url/presentation-api/controlling-ua/startNewPresentation_success-manual.html
(2) Click Start Presentation Test
(3) Select a Cast device 

What is the expected result?
Test passes

Actual:
Test fails.

assert_equals: Event order is incorrect. expected "Phase #1: Promise is resolved" but got "Phase #2: 'connectionavailable' event fired"
    at checkPhase (http://web-platform.test:8000/presentation-api/controlling-ua/startNewPresentation_success-manual.html:46:55)

Failing code in https://github.com/mfoltzgoogle/web-platform-tests/blob/single-presentation-url/presentation-api/controlling-ua/startNewPresentation_success-manual.html


 

Comment 1 by mfo...@chromium.org, Nov 28 2016

I think this is a test issue.  The Promise chain created from start() will resolve immediately, before the event handler for connectionavailable fires in a subsequent event loop.

mlamouri@, zhaobin@, WDYT?  I'll file a bug against the test if you agree.



Owner: zhaobin@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4e188d7c91feaff452f8cf8c93ac48a4393b8e5b

commit 4e188d7c91feaff452f8cf8c93ac48a4393b8e5b
Author: zhaobin <zhaobin@chromium.org>
Date: Fri Dec 09 18:49:00 2016

[Presentation API] fire onconnectionavailable and onconnect event asynchronously

We would like to ensure following execution order when calling PresentationRequest.start():

1. resolve start() promise
2. fire PresentationRequest onconnectionavailable event
3. fire PresentationConnection onconnect event

To fire event after resolving promise, we need to dispatch events asynchronously

BUG= 669213 

Review-Url: https://codereview.chromium.org/2547143002
Cr-Commit-Position: refs/heads/master@{#437598}

[modify] https://crrev.com/4e188d7c91feaff452f8cf8c93ac48a4393b8e5b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
[modify] https://crrev.com/4e188d7c91feaff452f8cf8c93ac48a4393b8e5b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h

Status: Fixed (was: Assigned)

Sign in to add a comment