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

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: cleanup (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..606a072cd33320fe4d785d3efdf2e8227d45a01d 100644
--- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
+++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -275,12 +275,18 @@ class DriveTestVolume {
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));
+ drive::DriveIntegrationServiceFactory::SetFactoryForTest(
+ &create_drive_integration_service_);
return true;
}
+ void TearDown() {
+ drive::DriveIntegrationServiceFactory::SetFactoryForTest(NULL);
+ }
+
void CreateEntry(const TestEntryInfo& entry) {
const base::FilePath path =
base::FilePath::FromUTF8Unsafe(entry.target_path);
@@ -414,6 +420,8 @@ class DriveTestVolume {
base::ScopedTempDir test_cache_root_;
drive::FakeDriveService* fake_drive_service_;
drive::DriveIntegrationService* integration_service_;
+ drive::DriveIntegrationServiceFactory::FactoryCallback
+ create_drive_integration_service_;
};
// Listener to obtain the test relative messages synchronously.
@@ -488,6 +496,7 @@ class FileManagerBrowserTest :
}
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE;
+ virtual void TearDownInProcessBrowserTestFixture() OVERRIDE;
virtual void SetUpOnMainThread() OVERRIDE;
@@ -509,6 +518,12 @@ void FileManagerBrowserTest::SetUpInProcessBrowserTestFixture() {
ASSERT_TRUE(drive_volume_->SetUp());
}
+void FileManagerBrowserTest::TearDownInProcessBrowserTestFixture() {
+ if (drive_volume_)
+ drive_volume_->TearDown();
+ ExtensionApiTest::TearDownInProcessBrowserTestFixture();
+}
+
void FileManagerBrowserTest::SetUpOnMainThread() {
ExtensionApiTest::SetUpOnMainThread();
ASSERT_TRUE(local_volume_->Mount(browser()->profile()));

Powered by Google App Engine
This is Rietveld 408576698