Reland "Make sure screen object is created once in tests."
This reverts commit c588769bdb90335b5c888e2bbce853529129a931.
Reason for revert: The CL didn't contain the fix for the first
revert [1]. I'll make sure both fixes are in in the next patch.
[1] https://chromium-review.googlesource.com/c/chromium/src/+/3651997/1..6
Original change's description:
> Revert "Make sure screen object is created once in tests."
>
> This reverts commit e68c6a62f4a64fe1a6e249b2e811aec5d8982198.
>
> Reason for revert: compile failure on Cast Linux Debug
> https://ci.chromium.org/p/chromium/builders/ci/Cast%20Linux%20Debug/46716
>
> Original change's description:
> > Make sure screen object is created once in tests.
> >
> > This is a reland of crrev.com/c/3247911. The mac failure, which
> > was the reason for revert, was due to the fact that mac launched
> > another app for PWA (app shim) which also needs a NativeScopedScreen.
> > PS1 is original patch, and PS2 is with the fix.
> >
> > -- original CL description:
> > Replacing a screen instance is not safe because it carries a lot
> > of state. This CL moves all test screen initialization to test SetUp
> > phase so that single screen instance will be used during
> > a single test.
> >
> > One exception is IOS because it currently relies on the implementation
> > that carries some state from one test to another, and I was unable to
> > eliminate that dependency. Looks like there is no IOS test that replaces
> > the screen instance, so it is not required, but someone who is familiar
> > with IOS needs to work on it if that's necessary.
> >
> > A class ScopedNativeScreen is added: This class creates and sets a NativeScreen instance only when the screen is not already created (by tests)
> >
> > Another class ScopedScreenOzone is added: This class creates and sets a ScreenOzone instance only when the screen is not already created (by tests). This is necessary as the creation of Screen may have to be delayed on some platform. I'll look into if we can fix or improve this separately.
> >
> > 2-pagers doc: https://docs.google.com/document/d/1q7lJnR06DhNtHYHZP8jpHzN19FUlcFWk7zDkyNQpxLU/edit?resourcekey=0-zO3n4kN3Ci1RLpvVAjpwAA
> >
> > Bug: 1317416
> > Change-Id: Ic928dda7d826aad73bd65d79197cb3ae0f726c04
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3671442
> > Reviewed-by: Mike West <[email protected]>
> > Reviewed-by: Robert Kroeger <[email protected]>
> > Reviewed-by: Sylvain Defresne <[email protected]>
> > Commit-Queue: Mitsuru Oshima <[email protected]>
> > Reviewed-by: Alex Moshchuk <[email protected]>
> > Reviewed-by: Scott Violet <[email protected]>
> > Reviewed-by: Mike Wasserman <[email protected]>
> > Reviewed-by: Andrey Kosyakov <[email protected]>
> > Reviewed-by: Wez <[email protected]>
> > Reviewed-by: Finnur Thorarinsson <[email protected]>
> > Reviewed-by: Gary Kacmarcik <[email protected]>
> > Cr-Commit-Position: refs/heads/main@{#1009843}
>
> Bug: 1317416
> Change-Id: If6d890a49c6d63c8dfd1a79a70c7c86bcfdb170e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3685949
> Bot-Commit: Rubber Stamper <[email protected]>
> Auto-Submit: Keishi Hattori <[email protected]>
> Owners-Override: Keishi Hattori <[email protected]>
> Commit-Queue: Keishi Hattori <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1009918}
Bug: 1317416
Change-Id: If90acc1e167b64534f1b8e8a74e49f14ee7d7cac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3685951
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Sylvain Defresne <[email protected]>
Reviewed-by: Andrey Kosyakov <[email protected]>
Reviewed-by: Mike Wasserman <[email protected]>
Reviewed-by: Finnur Thorarinsson <[email protected]>
Reviewed-by: David Dorwin <[email protected]>
Reviewed-by: Robert Kroeger <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Mike West <[email protected]>
Reviewed-by: Gary Kacmarcik <[email protected]>
Commit-Queue: Mitsuru Oshima <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1011300}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index cfac7fd..3fc8e08 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -5926,6 +5926,8 @@
"mac/auth_session_request.mm",
"mac/bluetooth_utility.h",
"mac/bluetooth_utility.mm",
+ "mac/chrome_browser_main_extra_parts_mac.h",
+ "mac/chrome_browser_main_extra_parts_mac.mm",
"mac/dock.h",
"mac/dock.mm",
"mac/exception_processor.h",