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

Issue 761561 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Presentation API layout tests are flaky

Project Member Reported by reillyg@chromium.org, Sep 1 2017

Issue description

When run by the LayoutTest runner the Presentation API tests are flaky because the renderer-side implementation holds on to a connection to the PresentationService across navigations.
 

Comment 1 by sko...@chromium.org, Sep 11 2017

Status: Available (was: Untriaged)

Comment 2 by mfo...@chromium.org, Oct 19 2017

Cc: zhaobin@chromium.org
Components: Tests>Flaky
Labels: -Pri-3 M-64 Pri-2
Owner: imch...@chromium.org
We should prioritize de-flaking our tests.

The current tests flake for me on a regular basis:

+presentation/presentation-controller-close-connection.html			timeout pass	pass
+presentation/presentation-start.html			timeout timeout pass	pass
+presentation/presentation-reconnect.html		timeout pass	pass
+presentation/presentation-controller-connection-closed-by-receiver.html			timeout timeout timeout pass	pass
+presentation/presentation-receiver-terminate-connection.html			timeout pass	pass

All of these test use the mock PresentationService so the flakiness seems related.

imcheng@ can you take a look at reillyg@'s comment and offer your analysis, to see if this is a quick fix or needs some real work.

I
Status: Started (was: Available)
There could be a quick fix. As PresentationDispatcher inherits from RenderFrameObserver, it could reset the PresentationServicePtr in DidCommitProvisionalLoad(). Once we remove PresentationDispatcher as part of onion soup, it shouldn't be a problem anymore. 

Note that we mock out PresentationService in layout tests. Also note that blink::PresentationController, which also holds on to a PresentationServicePtr, does not exhibit the same problem as PresentationDispatcher (because presumably it gets destroyed on navigation). Still, I think it would be nice to close the binding on the browser side PresentationServiceImpl::DidFinishNavigation.
Cc: imch...@chromium.org
 Issue 777648  has been merged into this issue.
This is being fixed as part of https://chromium-review.googlesource.com/c/chromium/src/+/724724
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 6 2017

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

commit f8ffbec53206b897830b41c3472350db28d65a8e
Author: Derek Cheng <imcheng@chromium.org>
Date: Wed Dec 06 19:43:04 2017

[PresentationAPI] Onion soup part 2.

Move screen availability logic PresentationDispatcher into Blink code.
A new class, blink::PresentationAvailabilityState, is introduced to keep
track of the availability and listening states of PresentationAvailability
objects. PresentationAvailabilityState is owned by
blink::PresentationController and shares its PresentationService mojo
ptr to communicate with the browser.
Also rename PresentationServiceClient Mojo interface to
PresentationController (in parallel with PresentationReceiver). With
the rename, we also move its implementation from PresentationDispatcher
into blink::PresentationController.

This allows us to remove WebPresentationController and
WebPresentationAvailabilityObserver.

This patch also fixes a bug (which also leads to layout test flakiness)
where Mojo message pipes for PresentationService/PresentationController
are not removed on navigation. This is fixed by resetting the bindings
and mojo ptrs in PresentationServiceImpl::Reset. We also reset the
PresentationService mojo ptr in
PresentationDispatcher::DidCommitProvisionalLoad as a temp fix while
PresentationDispatcher still remains.

Bug:  749327 ,  761561 
Change-Id: I8834f130fdc70879119ee81eeaf5b5965fec9098
Reviewed-on: https://chromium-review.googlesource.com/724724
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Derek Cheng <imcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522169}
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/content/browser/presentation/presentation_service_impl.cc
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/content/browser/presentation/presentation_service_impl.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/content/browser/presentation/presentation_service_impl_unittest.cc
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/content/renderer/presentation/presentation_dispatcher.cc
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/content/renderer/presentation/presentation_dispatcher.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/content/renderer/presentation/presentation_dispatcher_unittest.cc
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/BUILD.gn
[add] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/MockPresentationService.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/MockWebPresentationClient.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/Presentation.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.h
[add] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityObserver.h
[add] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityState.cpp
[add] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityState.h
[add] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityStateTest.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationConnection.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationController.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/Source/platform/BUILD.gn
[delete] https://crrev.com/e1d5593fe225687c9749759e01b0b389dac3a3a7/third_party/WebKit/Source/platform/exported/WebPresentationAvailabilityObserver.cpp
[delete] https://crrev.com/e1d5593fe225687c9749759e01b0b389dac3a3a7/third_party/WebKit/Source/platform/exported/WebPresentationController.cpp
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/public/BUILD.gn
[delete] https://crrev.com/e1d5593fe225687c9749759e01b0b389dac3a3a7/third_party/WebKit/public/platform/modules/presentation/WebPresentationAvailabilityObserver.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/public/platform/modules/presentation/WebPresentationClient.h
[delete] https://crrev.com/e1d5593fe225687c9749759e01b0b389dac3a3a7/third_party/WebKit/public/platform/modules/presentation/WebPresentationController.h
[modify] https://crrev.com/f8ffbec53206b897830b41c3472350db28d65a8e/third_party/WebKit/public/platform/modules/presentation/presentation.mojom

Comment 8 by mfo...@chromium.org, Jan 10 2018

Status: Verified (was: Started)
I ran the presentation layout tests 10 times and there were no test failures. 
Thanks for the fix @imcheng!


Sign in to add a comment