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.
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.
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.
Comment 1 by sko...@chromium.org
, Sep 11 2017