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

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

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
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);
« no previous file with comments | « chrome/browser/extensions/settings/settings_test_util.cc ('k') | chrome/browser/google/google_url_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698