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

Unified Diff: chrome/browser/extensions/updater/extension_updater_unittest.cc

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments. merge to ToT. Murder a DB thread and more TestBrowserThreads. Created 7 years, 5 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/updater/extension_updater_unittest.cc
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index f0e433099ea3dbb54f299896e1d61f6b541d1e7a..45bba108d5e3ad13d3745468cf1dd091f5d24bc6 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -50,7 +50,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "extensions/common/id_util.h"
#include "libxml/globals.h"
#include "net/base/backoff_entry.h"
@@ -210,7 +210,6 @@ class MockService : public TestExtensionService {
: prefs_(prefs),
pending_extension_manager_(*this),
blacklist_(prefs_->prefs()) {
- profile_.CreateRequestContext();
}
virtual ~MockService() {}
@@ -468,17 +467,8 @@ static void VerifyQueryAndExtractParameters(
// inside this class (which is a friend to ExtensionUpdater).
class ExtensionUpdaterTest : public testing::Test {
public:
- ExtensionUpdaterTest()
- : ui_thread_(BrowserThread::UI, &loop_),
- file_thread_(BrowserThread::FILE, &loop_),
- io_thread_(BrowserThread::IO, &loop_) {
- }
-
- virtual ~ExtensionUpdaterTest() {
- }
-
virtual void SetUp() OVERRIDE {
- prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy().get()));
+ prefs_.reset(new TestExtensionPrefs(base::MessageLoopProxy::current()));
}
virtual void TearDown() OVERRIDE {
@@ -491,7 +481,7 @@ class ExtensionUpdaterTest : public testing::Test {
void RunUntilIdle() {
prefs_->pref_service()->CommitPendingWrite();
- loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void SimulateTimerFired(ExtensionUpdater* updater) {
@@ -721,7 +711,6 @@ class ExtensionUpdaterTest : public testing::Test {
void TestDetermineUpdates() {
TestingProfile profile;
- profile.CreateRequestContext();
MockExtensionDownloaderDelegate delegate;
ExtensionDownloader downloader(&delegate, profile.GetRequestContext());
@@ -765,7 +754,6 @@ class ExtensionUpdaterTest : public testing::Test {
SetupPendingExtensionManagerForTest(3, GURL(), pending_extension_manager);
TestingProfile profile;
- profile.CreateRequestContext();
MockExtensionDownloaderDelegate delegate;
ExtensionDownloader downloader(&delegate, profile.GetRequestContext());
@@ -1308,7 +1296,7 @@ class ExtensionUpdaterTest : public testing::Test {
// Set up 2 mock extensions, one with a google.com update url and one
// without.
- prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy().get()));
+ prefs_.reset(new TestExtensionPrefs(base::MessageLoopProxy::current()));
ServiceForManifestTests service(prefs_.get());
ExtensionList tmp;
GURL url1("http://clients2.google.com/service/update2/crx");
@@ -1468,10 +1456,7 @@ class ExtensionUpdaterTest : public testing::Test {
scoped_ptr<TestExtensionPrefs> prefs_;
private:
- base::MessageLoop loop_;
- content::TestBrowserThread ui_thread_;
- content::TestBrowserThread file_thread_;
- content::TestBrowserThread io_thread_;
+ content::TestBrowserThreadBundle thread_bundle_;
#if defined OS_CHROMEOS
chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;

Powered by Google App Engine
This is Rietveld 408576698