Index: chrome/browser/extensions/api/storage/settings_frontend_unittest.cc |
diff --git a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc |
index 9eb8e45860957ab0053274c53a26442572b2197b..249d54ec22ea8ce6be178855efb7f1ff31973ed3 100644 |
--- a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc |
+++ b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc |
@@ -7,6 +7,7 @@ |
#include "base/files/scoped_temp_dir.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/run_loop.h" |
#include "base/strings/stringprintf.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h" |
@@ -14,7 +15,8 @@ |
#include "chrome/browser/extensions/api/storage/settings_namespace.h" |
#include "chrome/browser/extensions/api/storage/settings_test_util.h" |
#include "chrome/browser/value_store/value_store.h" |
-#include "content/public/test/test_browser_thread.h" |
+#include "content/public/browser/browser_thread.h" |
+#include "content/public/test/test_browser_thread_bundle.h" |
#include "testing/gtest/include/gtest/gtest.h" |
using content::BrowserThread; |
@@ -52,9 +54,7 @@ scoped_ptr<Value> CreateMegabyte() { |
class ExtensionSettingsFrontendTest : public testing::Test { |
public: |
ExtensionSettingsFrontendTest() |
- : storage_factory_(new util::ScopedSettingsStorageFactory()), |
- ui_thread_(BrowserThread::UI, base::MessageLoop::current()), |
- file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} |
+ : storage_factory_(new util::ScopedSettingsStorageFactory()) {} |
virtual void SetUp() OVERRIDE { |
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
@@ -66,7 +66,7 @@ class ExtensionSettingsFrontendTest : public testing::Test { |
frontend_.reset(); |
profile_.reset(); |
// Execute any pending deletion tasks. |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
protected: |
@@ -76,15 +76,11 @@ class ExtensionSettingsFrontendTest : public testing::Test { |
SettingsFrontend::Create(storage_factory_.get(), profile_.get())); |
} |
+ content::TestBrowserThreadBundle thread_bundle_; |
base::ScopedTempDir temp_dir_; |
scoped_ptr<util::MockProfile> profile_; |
scoped_ptr<SettingsFrontend> frontend_; |
scoped_refptr<util::ScopedSettingsStorageFactory> storage_factory_; |
- |
- private: |
- base::MessageLoop message_loop_; |
- content::TestBrowserThread ui_thread_; |
- content::TestBrowserThread file_thread_; |
}; |
// Get a semblance of coverage for both extension and app settings by |
@@ -141,7 +137,7 @@ TEST_F(ExtensionSettingsFrontendTest, SettingsClearedOnUninstall) { |
// This would be triggered by extension uninstall via a DataDeleter. |
frontend_->DeleteStorageSoon(id); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
// The storage area may no longer be valid post-uninstall, so re-request. |
storage = util::GetStorage(id, frontend_.get()); |
@@ -177,7 +173,7 @@ TEST_F(ExtensionSettingsFrontendTest, LeveldbDatabaseDeletedFromDiskOnClear) { |
} |
frontend_.reset(); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
// TODO(kalman): Figure out why this fails, despite appearing to work. |
// Leaving this commented out rather than disabling the whole test so that the |
// deletion code paths are at least exercised. |
@@ -282,7 +278,7 @@ TEST_F(ExtensionSettingsFrontendTest, |
frontend_->RunWithStorage( |
id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
} // namespace extensions |