Do not open browser when testing sign-in extensions
SigninExtensionsDeviceCloudPolicyBrowserTests were opening a browser window in Sign-in profile and running the test code in that context. In general, browser windows should not be used in sign-in profile, so we should not rely on this behavior in tests. The test code is moved to the test extensions background page, and run on runtime.onInstalled event (which should be dispatched on each extension install event - note that running the tests in event listener is not strictly necessary, but it gives better indication of the reason the background page is loaded). Given that in sign-in profile, background hosts are not allowed for non-policy installed extensions, the test is updated to set up policy to force install the test extension (which is packed into a CRX, which is added to test data dir). Furthermore, the test extension is transformed to an app, and whitelisted using whitelisted-extension-id switch. This makes ScopedSigninScreenPolicyProviderDisabler unnecessary. PreinstalledSigninExtensionsDeviceCloudPolicyBrowserTest is dropped, and the component policy caching is tested by running sign-in extension device policy tests in two parts: * first, PRE_ManagedStorage test downloads the component policy from the tests server and runs the test extension (matches the logic in replaced InstallAndRunInWindow test) * the second, ManagedStorage test verifies that the downloaded policy is cached and usable after restart by throttling the component policy download request. BUG=916859 Change-Id: Ia0748c2914649ea439664d748aca0bd5461a397f Reviewed-on: https://chromium-review.googlesource.com/c/1379702Reviewed-by:Maksim Ivanov <emaxx@chromium.org> Commit-Queue: Toni Baržić <tbarzic@chromium.org> Cr-Commit-Position: refs/heads/master@{#619545}
Showing
This diff is collapsed.
File added
File moved
Please register or sign in to comment