diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:17:11 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:17:11 +0000 |
commit | dd32b127ce5deac52b24f493dac79195a30bf138 (patch) | |
tree | fe41d5b0b6fb1bcff0ccfc87a9f46cefee602723 /content/browser/browser_thread_unittest.cc | |
parent | 63b5c710324dc630a663eb76a6a4cc1372322830 (diff) | |
download | chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.zip chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.tar.gz chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.tar.bz2 |
content: Use base::MessageLoop.
BUG=236029
R=avi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14335017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_thread_unittest.cc')
-rw-r--r-- | content/browser/browser_thread_unittest.cc | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc index 06b1951..ec4b7cc 100644 --- a/content/browser/browser_thread_unittest.cc +++ b/content/browser/browser_thread_unittest.cc @@ -19,7 +19,7 @@ class BrowserThreadTest : public testing::Test { public: void Release() const { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); + loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } protected: @@ -35,17 +35,17 @@ class BrowserThreadTest : public testing::Test { file_thread_->Stop(); } - static void BasicFunction(MessageLoop* message_loop) { + static void BasicFunction(base::MessageLoop* message_loop) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } class DeletedOnFile : public base::RefCountedThreadSafe< DeletedOnFile, BrowserThread::DeleteOnFileThread> { public: - explicit DeletedOnFile(MessageLoop* message_loop) - : message_loop_(message_loop) { } + explicit DeletedOnFile(base::MessageLoop* message_loop) + : message_loop_(message_loop) {} private: friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>; @@ -53,10 +53,10 @@ class BrowserThreadTest : public testing::Test { ~DeletedOnFile() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; }; private: @@ -64,42 +64,43 @@ class BrowserThreadTest : public testing::Test { scoped_ptr<BrowserThreadImpl> file_thread_; // It's kind of ugly to make this mutable - solely so we can post the Quit // Task from Release(). This should be fixed. - mutable MessageLoop loop_; + mutable base::MessageLoop loop_; }; TEST_F(BrowserThreadTest, PostTask) { BrowserThread::PostTask( - BrowserThread::FILE, FROM_HERE, - base::Bind(&BasicFunction, MessageLoop::current())); - MessageLoop::current()->Run(); + BrowserThread::FILE, + FROM_HERE, + base::Bind(&BasicFunction, base::MessageLoop::current())); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, Release) { BrowserThread::ReleaseSoon(BrowserThread::UI, FROM_HERE, this); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) { { scoped_refptr<DeletedOnFile> test( - new DeletedOnFile(MessageLoop::current())); + new DeletedOnFile(base::MessageLoop::current())); } - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); message_loop_proxy->PostTask( - FROM_HERE, base::Bind(&BasicFunction, MessageLoop::current())); - MessageLoop::current()->Run(); + FROM_HERE, base::Bind(&BasicFunction, base::MessageLoop::current())); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, ReleaseViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); message_loop_proxy->ReleaseSoon(FROM_HERE, this); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, PostTaskAndReply) { @@ -109,9 +110,9 @@ TEST_F(BrowserThreadTest, PostTaskAndReply) { BrowserThread::FILE, FROM_HERE, base::Bind(&base::DoNothing), - base::Bind(&MessageLoop::Quit, - base::Unretained(MessageLoop::current()->current())))); - MessageLoop::current()->Run(); + base::Bind(&base::MessageLoop::Quit, + base::Unretained(base::MessageLoop::current()->current())))); + base::MessageLoop::current()->Run(); } } // namespace content |