MacPWAs: Decouple AppShimHost and AppShimHostBootstrap
Update AppShimHandler::OnShimLaunch to take a AppShimHostBootstrap, and use that to create an AppShimHost, rather than having the caller create the AppShimHost. * Have the method for AppShimHost creation be in the AppShimHandler::Delegate class for overriding in tests. * This sets us up to have the AppShimHost be created before the app shim process has completed launching (and thereby be able to queue up creating windows in the app shim process). Add to AppShimHandler::Host's public interface an OnBootstrapConnected function, where the AppShimHandler::Host takes ownership of the app shim process. * This is currently always called immediately after the AppShimHost's creation, but that will change in the next patch. Make the tests rely more heavily on the real classes instead of fake stubs. In particular, I plan to remove AppShimHandler::Host as an abstract interface because the tests cover much more ground when run on the real test (and the one real implementation, AppShimHost, has no other public methods). Make one subtle change in the tests. In the event of a duplicate app launch, the app's windows will be focused by the existing AppShimHost, because we don't create an AppShimHost in the event of any failure. This has the same user-visible behavior (because the windows being focused are the same). Re-land of crrev.com/603821 TBR=dominickn Bug: 896917 Change-Id: I4efc493d048e898d86aca736244a8e5a5672ccef Reviewed-on: https://chromium-review.googlesource.com/c/1309222Reviewed-by:ccameron <ccameron@chromium.org> Commit-Queue: ccameron <ccameron@chromium.org> Cr-Commit-Position: refs/heads/master@{#604153}
Showing
This diff is collapsed.
Please register or sign in to comment