Commit ce92ada9 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

Rid our system of persistent FileManagerBrowserTest flakiness

Postpone the creation of the FilesApp component extensions AudioPlayer
FileManager, Gallery, and VideoPlayer in browser testing. Not doing so
leads to systemic browser test failures (flakiness) per the bugs.

Fix: prepare test resources first, load the component extensions, then
start testing. Failure was the component extensions were active before
the file resources needed by the tests were ready, causing flake-fails
when the component extensions tried to access those resources.

Bug: 831074, 804413, 829310
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ie794bac638f48c3855e0c1f1609e59aa615c31dd
Reviewed-on: https://chromium-review.googlesource.com/1013823
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarTomasz Mikolajewski <mtomasz@chromium.org>
Reviewed-by: default avatarTatsuhisa Yamaguchi <yamaguchi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551279}
parent 977c472e
......@@ -526,7 +526,6 @@ void FileManagerBrowserTestBase::SetUpCommandLine(
void FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture() {
ExtensionApiTest::SetUpInProcessBrowserTestFixture();
extensions::ComponentLoader::EnableBackgroundExtensionsForTesting();
local_volume_.reset(new DownloadsTestVolume);
if (GetGuestModeParam() != IN_GUEST_MODE) {
......@@ -543,18 +542,6 @@ void FileManagerBrowserTestBase::SetUpOnMainThread() {
ExtensionApiTest::SetUpOnMainThread();
CHECK(profile());
// The file manager component app should have been added for loading into the
// user profile, but not into the sign-in profile.
CHECK(extensions::ExtensionSystem::Get(profile())
->extension_service()
->component_loader()
->Exists(kFileManagerAppId));
CHECK(!extensions::ExtensionSystem::Get(
chromeos::ProfileHelper::GetSigninProfile())
->extension_service()
->component_loader()
->Exists(kFileManagerAppId));
CHECK(local_volume_->Mount(profile()));
if (GetGuestModeParam() != IN_GUEST_MODE) {
......@@ -569,6 +556,25 @@ void FileManagerBrowserTestBase::SetUpOnMainThread() {
display_service_ =
std::make_unique<NotificationDisplayServiceTester>(profile());
// The test resources are setup: enable and add default ChromeOS component
// extensions now and not before: crbug.com/831074, crbug.com/804413
extensions::ComponentLoader::EnableBackgroundExtensionsForTesting();
ExtensionService* service =
extensions::ExtensionSystem::Get(profile())->extension_service();
service->component_loader()->AddDefaultComponentExtensions(false);
// The File Manager component extension should have been added for loading
// into the user profile, but not into the sign-in profile.
CHECK(extensions::ExtensionSystem::Get(profile())
->extension_service()
->component_loader()
->Exists(kFileManagerAppId));
CHECK(!extensions::ExtensionSystem::Get(
chromeos::ProfileHelper::GetSigninProfile())
->extension_service()
->component_loader()
->Exists(kFileManagerAppId));
}
void FileManagerBrowserTestBase::StartTest() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment