Index: chrome/browser/extensions/user_script_listener_unittest.cc |
diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc |
index fcc3bb49d7bd975985343eee48244d43351f3f5d..b0fc268697ea572497a6b8cafeb0e1a9c545130e 100644 |
--- a/chrome/browser/extensions/user_script_listener_unittest.cc |
+++ b/chrome/browser/extensions/user_script_listener_unittest.cc |
@@ -116,14 +116,14 @@ class UserScriptListenerTest |
InitializeEmptyExtensionService(); |
service_->Init(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
listener_ = new UserScriptListener(); |
} |
virtual void TearDown() { |
listener_ = NULL; |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
} |
// net::URLRequest::Interceptor |
@@ -181,7 +181,7 @@ namespace { |
TEST_F(UserScriptListenerTest, DelayAndUpdate) { |
LoadTestExtension(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
net::TestDelegate delegate; |
net::TestURLRequestContext context; |
@@ -193,13 +193,13 @@ TEST_F(UserScriptListenerTest, DelayAndUpdate) { |
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
content::Source<Profile>(profile_.get()), |
content::NotificationService::NoDetails()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
EXPECT_EQ(kTestData, delegate.data_received()); |
} |
TEST_F(UserScriptListenerTest, DelayAndUnload) { |
LoadTestExtension(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
net::TestDelegate delegate; |
net::TestURLRequestContext context; |
@@ -208,7 +208,7 @@ TEST_F(UserScriptListenerTest, DelayAndUnload) { |
ASSERT_FALSE(request->is_pending()); |
UnloadTestExtension(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
// This is still not enough to start delayed requests. We have to notify the |
// listener that the user scripts have been updated. |
@@ -218,7 +218,7 @@ TEST_F(UserScriptListenerTest, DelayAndUnload) { |
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
content::Source<Profile>(profile_.get()), |
content::NotificationService::NoDetails()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
EXPECT_EQ(kTestData, delegate.data_received()); |
} |
@@ -231,13 +231,13 @@ TEST_F(UserScriptListenerTest, NoDelayNoExtension) { |
// The request should be started immediately. |
ASSERT_TRUE(request->is_pending()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
EXPECT_EQ(kTestData, delegate.data_received()); |
} |
TEST_F(UserScriptListenerTest, NoDelayNotMatching) { |
LoadTestExtension(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
net::TestDelegate delegate; |
net::TestURLRequestContext context; |
@@ -248,13 +248,13 @@ TEST_F(UserScriptListenerTest, NoDelayNotMatching) { |
// The request should be started immediately. |
ASSERT_TRUE(request->is_pending()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
EXPECT_EQ(kTestData, delegate.data_received()); |
} |
TEST_F(UserScriptListenerTest, MultiProfile) { |
LoadTestExtension(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
// Fire up a second profile and have it load and extension with a content |
// script. |
@@ -281,7 +281,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { |
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
content::Source<Profile>(profile_.get()), |
content::NotificationService::NoDetails()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
ASSERT_FALSE(request->is_pending()); |
EXPECT_TRUE(delegate.data_received().empty()); |
@@ -290,7 +290,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { |
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
content::Source<Profile>(&profile2), |
content::NotificationService::NoDetails()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
EXPECT_EQ(kTestData, delegate.data_received()); |
} |
@@ -299,7 +299,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { |
// throttles. |
TEST_F(UserScriptListenerTest, ResumeBeforeStart) { |
LoadTestExtension(); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
net::TestDelegate delegate; |
net::TestURLRequestContext context; |
GURL url(kMatchingUrl); |
@@ -317,7 +317,7 @@ TEST_F(UserScriptListenerTest, ResumeBeforeStart) { |
chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
content::Source<Profile>(profile_.get()), |
content::NotificationService::NoDetails()); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
bool defer = false; |
throttle->WillStartRequest(&defer); |