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

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 7 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/crash_handler_host_linux.cc ('k') | chrome/browser/devtools/devtools_adb_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
index db486c23acd6c4d87ddd661665a16bb670142ef0..d29c0c05d2d6357920b0e8089ae3bfc32c21d7d5 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc
@@ -51,7 +51,7 @@ void AssertIntercepted(
base::Bind(AssertInterceptedIO,
url,
base::Unretained(interceptor)));
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
}
// FakeURLRequestJobFactory returns NULL for all job creation requests and false
@@ -100,7 +100,7 @@ void AssertWillHandle(
scheme,
expected,
base::Unretained(interceptor)));
- MessageLoop::current()->RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
}
class FakeDelegate : public ProtocolHandlerRegistry::Delegate {
@@ -178,7 +178,7 @@ class FakeClientObserver
delegate_->FakeRegisterWithOS(worker_->protocol());
}
if (state != ShellIntegration::STATE_PROCESSING) {
- MessageLoop::current()->Quit();
+ base::MessageLoop::current()->Quit();
}
}
@@ -280,19 +280,19 @@ class QueryProtocolHandlerOnChange
// guarantee all messages are processed.) By overriding the IsType method
// we basically ignore the supplied message loop type, and instead infer
// our type based on the current thread. GO DEPENDENCY INJECTION!
-class TestMessageLoop : public MessageLoop {
+class TestMessageLoop : public base::MessageLoop {
public:
- TestMessageLoop() : MessageLoop(MessageLoop::TYPE_DEFAULT) {}
+ TestMessageLoop() : base::MessageLoop(base::MessageLoop::TYPE_DEFAULT) {}
virtual ~TestMessageLoop() {}
- virtual bool IsType(MessageLoop::Type type) const OVERRIDE {
+ virtual bool IsType(base::MessageLoop::Type type) const OVERRIDE {
switch (type) {
- case MessageLoop::TYPE_UI:
- return BrowserThread::CurrentlyOn(BrowserThread::UI);
- case MessageLoop::TYPE_IO:
- return BrowserThread::CurrentlyOn(BrowserThread::IO);
- case MessageLoop::TYPE_DEFAULT:
- return !BrowserThread::CurrentlyOn(BrowserThread::UI) &&
- !BrowserThread::CurrentlyOn(BrowserThread::IO);
+ case base::MessageLoop::TYPE_UI:
+ return BrowserThread::CurrentlyOn(BrowserThread::UI);
+ case base::MessageLoop::TYPE_IO:
+ return BrowserThread::CurrentlyOn(BrowserThread::IO);
+ case base::MessageLoop::TYPE_DEFAULT:
+ return !BrowserThread::CurrentlyOn(BrowserThread::UI) &&
+ !BrowserThread::CurrentlyOn(BrowserThread::IO);
}
return false;
}
@@ -734,7 +734,7 @@ TEST_F(ProtocolHandlerRegistryTest, TestOSRegistration) {
registry()->OnAcceptRegisterProtocolHandler(ph_do1);
registry()->OnDenyRegisterProtocolHandler(ph_dont);
- MessageLoop::current()->Run(); // FILE thread needs to run.
+ base::MessageLoop::current()->Run(); // FILE thread needs to run.
ASSERT_TRUE(delegate()->IsFakeRegisteredWithOS("do"));
ASSERT_FALSE(delegate()->IsFakeRegisteredWithOS("dont"));
@@ -764,10 +764,10 @@ TEST_F(ProtocolHandlerRegistryTest, MAYBE_TestOSRegistrationFailure) {
ASSERT_FALSE(registry()->IsHandledProtocol("dont"));
registry()->OnAcceptRegisterProtocolHandler(ph_do);
- MessageLoop::current()->Run(); // FILE thread needs to run.
+ base::MessageLoop::current()->Run(); // FILE thread needs to run.
delegate()->set_force_os_failure(true);
registry()->OnAcceptRegisterProtocolHandler(ph_dont);
- MessageLoop::current()->Run(); // FILE thread needs to run.
+ base::MessageLoop::current()->Run(); // FILE thread needs to run.
ASSERT_TRUE(registry()->IsHandledProtocol("do"));
ASSERT_EQ(static_cast<size_t>(1), registry()->GetHandlersFor("do").size());
ASSERT_FALSE(registry()->IsHandledProtocol("dont"));
« no previous file with comments | « chrome/browser/crash_handler_host_linux.cc ('k') | chrome/browser/devtools/devtools_adb_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698