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

Unified Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest.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/file_manager_browsertest.cc
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
index b955a7f2fe07093284d36298e0cdb6e1f51250dd..2f34ce1f0bd9b560f52ba606953fa865f1e29247 100644
--- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
+++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -42,6 +42,8 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "webkit/browser/fileapi/external_mount_points.h"
+using drive::DriveIntegrationServiceFactory;
+
namespace file_manager {
namespace {
@@ -270,14 +272,17 @@ class DriveTestVolume {
}
// Sends request to add this volume to the file system as Google drive.
- // This method must be calld at SetUp method of FileManagerBrowserTestBase.
+ // This method must be called at SetUp method of FileManagerBrowserTestBase.
// Returns true on success.
bool SetUp() {
if (!test_cache_root_.CreateUniqueTempDir())
return false;
- drive::DriveIntegrationServiceFactory::SetFactoryForTest(
+ create_drive_integration_service_ =
base::Bind(&DriveTestVolume::CreateDriveIntegrationService,
- base::Unretained(this)));
+ base::Unretained(this));
+ service_factory_for_test_.reset(
+ new DriveIntegrationServiceFactory::ScopedFactoryForTest(
+ &create_drive_integration_service_));
return true;
}
@@ -414,6 +419,10 @@ class DriveTestVolume {
base::ScopedTempDir test_cache_root_;
drive::FakeDriveService* fake_drive_service_;
drive::DriveIntegrationService* integration_service_;
+ DriveIntegrationServiceFactory::FactoryCallback
+ create_drive_integration_service_;
+ scoped_ptr<DriveIntegrationServiceFactory::ScopedFactoryForTest>
+ service_factory_for_test_;
};
// Listener to obtain the test relative messages synchronously.

Powered by Google App Engine
This is Rietveld 408576698