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

Unified Diff: chrome/browser/extensions/extensions_service_unittest.cc

Issue 345023: Get rid of MessageLoop* caching in extensions code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service_unittest.cc
===================================================================
--- chrome/browser/extensions/extensions_service_unittest.cc (revision 30521)
+++ chrome/browser/extensions/extensions_service_unittest.cc (working copy)
@@ -194,7 +194,10 @@
class ExtensionsServiceTest
: public testing::Test, public NotificationObserver {
public:
- ExtensionsServiceTest() : installed_(NULL) {
+ ExtensionsServiceTest()
+ : ui_thread_(ChromeThread::UI, &loop_),
+ file_thread_(ChromeThread::FILE, &loop_),
+ installed_(NULL) {
registrar_.Add(this, NotificationType::EXTENSION_LOADED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
@@ -213,8 +216,6 @@
CommandLine::ForCurrentProcess(),
prefs_.get(),
extensions_install_dir,
- &loop_,
- &loop_,
false);
service_->set_extensions_enabled(true);
service_->set_show_extensions_prompts(false);
@@ -468,6 +469,8 @@
scoped_refptr<ExtensionsService> service_;
size_t total_successes_;
MessageLoop loop_;
+ ChromeThread ui_thread_;
+ ChromeThread file_thread_;
ExtensionList loaded_;
std::string unloaded_id_;
Extension* installed_;
@@ -1527,6 +1530,8 @@
ExtensionsReadyRecorder recorder;
TestingProfile profile;
MessageLoop loop;
+ ChromeThread ui_thread(ChromeThread::UI, &loop);
+ ChromeThread file_thread(ChromeThread::FILE, &loop);
scoped_ptr<CommandLine> command_line;
scoped_refptr<ExtensionsService> service;
FilePath install_dir = profile.GetPath()
@@ -1535,7 +1540,7 @@
// By default, we are enabled.
command_line.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY));
service = new ExtensionsService(&profile, command_line.get(),
- profile.GetPrefs(), install_dir, &loop, &loop, false);
+ profile.GetPrefs(), install_dir, false);
EXPECT_TRUE(service->extensions_enabled());
service->Init();
loop.RunAllPending();
@@ -1545,7 +1550,7 @@
recorder.set_ready(false);
command_line->AppendSwitch(switches::kDisableExtensions);
service = new ExtensionsService(&profile, command_line.get(),
- profile.GetPrefs(), install_dir, &loop, &loop, false);
+ profile.GetPrefs(), install_dir, false);
EXPECT_FALSE(service->extensions_enabled());
service->Init();
loop.RunAllPending();
@@ -1554,7 +1559,7 @@
recorder.set_ready(false);
profile.GetPrefs()->SetBoolean(prefs::kDisableExtensions, true);
service = new ExtensionsService(&profile, command_line.get(),
- profile.GetPrefs(), install_dir, &loop, &loop, false);
+ profile.GetPrefs(), install_dir, false);
EXPECT_FALSE(service->extensions_enabled());
service->Init();
loop.RunAllPending();
@@ -1563,7 +1568,7 @@
recorder.set_ready(false);
command_line.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY));
service = new ExtensionsService(&profile, command_line.get(),
- profile.GetPrefs(), install_dir, &loop, &loop, false);
+ profile.GetPrefs(), install_dir, false);
EXPECT_FALSE(service->extensions_enabled());
service->Init();
loop.RunAllPending();
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | chrome/browser/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698