summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc7
-rw-r--r--chrome/browser/extensions/user_script_listener_unittest.cc8
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index aa38fe6..63a12a2 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -209,6 +209,13 @@ class ExtensionsServiceTest
NotificationService::AllSources());
}
+ ~ExtensionsServiceTest() {
+ // Drop our reference to ExtensionsService now, so that it can be destroyed
+ // while ChromeThreads and MessageLoop are still around (they are used
+ // in the ExtensionsService destruction process).
+ service_ = NULL;
+ }
+
virtual void InitializeExtensionsService(const FilePath& pref_file,
const FilePath& extensions_install_dir) {
prefs_.reset(new PrefService(pref_file));
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc
index e36a05f..35cf1d8 100644
--- a/chrome/browser/extensions/user_script_listener_unittest.cc
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc
@@ -207,6 +207,10 @@ class ExtensionTestingProfile : public TestingProfile {
service_->Init();
}
+ void ShutdownExtensionsService() {
+ service_ = NULL;
+ }
+
virtual ExtensionsService* GetExtensionsService() {
return service_.get();
}
@@ -239,6 +243,10 @@ class UserScriptListenerTest : public testing::Test {
}
virtual void TearDown() {
+ // Shutdown ExtensionsService now, so that it can be destroyed while
+ // ChromeThreads and MessageLoop are still around (they are used in the
+ // ExtensionsService destruction process).
+ profile_.ShutdownExtensionsService();
io_thread_.reset();
file_thread_.reset();
ui_thread_.reset();