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

Unified Diff: chrome/browser/extensions/api/storage/settings_frontend_unittest.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android webview init fix merged in. Created 7 years, 4 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/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

Powered by Google App Engine
This is Rietveld 408576698