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

Unified Diff: chrome/browser/extensions/user_script_listener_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/user_script_listener.cc ('k') | chrome/browser/extensions/user_script_master.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/user_script_listener_unittest.cc
===================================================================
--- chrome/browser/extensions/user_script_listener_unittest.cc (revision 30521)
+++ chrome/browser/extensions/user_script_listener_unittest.cc (working copy)
@@ -31,8 +31,8 @@
class MockUserScriptMaster : public UserScriptMaster {
public:
- explicit MockUserScriptMaster(MessageLoop* worker, const FilePath& script_dir)
- : UserScriptMaster(worker, script_dir) {}
+ explicit MockUserScriptMaster(const FilePath& script_dir)
+ : UserScriptMaster(script_dir) {}
virtual void StartScan() {
// Do nothing. We want to manually control when scans occur.
@@ -184,6 +184,8 @@
class UserScriptListenerTest : public testing::Test {
public:
virtual void SetUp() {
+ ui_thread_.reset(new ChromeThread(ChromeThread::UI, &loop_));
+ file_thread_.reset(new ChromeThread(ChromeThread::FILE, &loop_));
io_thread_.reset(new MockIOThread());
base::Thread::Options options(MessageLoop::TYPE_IO, 0);
io_thread_->StartWithOptions(options);
@@ -196,14 +198,12 @@
resource_tester_ =
new ResourceDispatcherHostTester(io_thread_->message_loop());
- master_ = new MockUserScriptMaster(&loop_, install_dir);
+ master_ = new MockUserScriptMaster(install_dir);
service_ = new ExtensionsService(&profile_,
CommandLine::ForCurrentProcess(),
profile_.GetPrefs(),
install_dir,
- &loop_,
- &loop_,
false);
service_->set_extensions_enabled(true);
service_->set_show_extensions_prompts(false);
@@ -213,12 +213,16 @@
virtual void TearDown() {
io_thread_.reset();
+ file_thread_.reset();
+ ui_thread_.reset();
resource_tester_ = NULL;
}
protected:
TestingProfile profile_;
MessageLoopForUI loop_;
+ scoped_ptr<ChromeThread> ui_thread_;
+ scoped_ptr<ChromeThread> file_thread_;
scoped_ptr<MockIOThread> io_thread_;
scoped_refptr<ResourceDispatcherHostTester> resource_tester_;
scoped_refptr<MockUserScriptMaster> master_;
« no previous file with comments | « chrome/browser/extensions/user_script_listener.cc ('k') | chrome/browser/extensions/user_script_master.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698