Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3313)

Unified Diff: chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc

Issue 118043003: Fix app_shell shutdown crash due to BrowserContextKeyedServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScopedFactoryForTest (shutdown_crash) Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
diff --git a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
index f06038c2df7e7a9524c4af38f7d1cf1f60538969..34790635df18f2256b75c175a1285fc3a1fffe4e 100644
--- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
+++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc
@@ -43,6 +43,7 @@
// - Doing searches on drive file system from file browser extension (using
// fileBrowserPrivate API).
+using drive::DriveIntegrationServiceFactory;
using extensions::Extension;
namespace file_manager {
@@ -298,10 +299,13 @@ class DriveFileSystemExtensionApiTest : public FileSystemExtensionApiTestBase {
// initialized by EventRouter.
ASSERT_TRUE(test_cache_root_.CreateUniqueTempDir());
- drive::DriveIntegrationServiceFactory::SetFactoryForTest(
- base::Bind(
- &DriveFileSystemExtensionApiTest::CreateDriveIntegrationService,
- base::Unretained(this)));
+ // This callback will get called during Profile creation.
+ create_drive_integration_service_ = base::Bind(
+ &DriveFileSystemExtensionApiTest::CreateDriveIntegrationService,
+ base::Unretained(this));
+ service_factory_for_test_.reset(
+ new DriveIntegrationServiceFactory::ScopedFactoryForTest(
+ &create_drive_integration_service_));
}
// FileSystemExtensionApiTestBase OVERRIDE.
@@ -326,6 +330,10 @@ class DriveFileSystemExtensionApiTest : public FileSystemExtensionApiTestBase {
base::ScopedTempDir test_cache_root_;
drive::FakeDriveService* fake_drive_service_;
+ DriveIntegrationServiceFactory::FactoryCallback
+ create_drive_integration_service_;
+ scoped_ptr<DriveIntegrationServiceFactory::ScopedFactoryForTest>
+ service_factory_for_test_;
};
//

Powered by Google App Engine
This is Rietveld 408576698