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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host_unittest_posix.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/api/messaging/native_message_process_host_unittest_posix.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest_posix.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest_posix.cc
index 95c93b1ac2ab3c187f01e11edfb6ff59f000cc53..c45fbfff417bce7f9883ade60de69e89aef39f2e 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest_posix.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest_posix.cc
@@ -91,7 +91,7 @@ class NativeMessagingTest : public ::testing::Test,
ASSERT_TRUE(PathService::Override(chrome::DIR_USER_DATA, user_data_dir_));
BrowserThread::DeleteSoon(BrowserThread::FILE, FROM_HERE,
native_message_process_host_);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
void PostMessageFromNativeProcess(int port_id, const std::string& message) {
@@ -127,10 +127,10 @@ TEST_F(NativeMessagingTest, SingleSendMessageRead) {
NativeMessageProcessHost::TYPE_SEND_MESSAGE_REQUEST, base::Bind(
&NativeMessagingTest::AcquireProcess, AsWeakPtr()),
launcher);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ASSERT_TRUE(native_message_process_host_);
native_message_process_host_->ReadNowForTesting();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(last_posted_message_, "{\"text\": \"Hi There!.\"}");
file_util::Delete(temp_file, false /* non-recursive */);
}
@@ -147,7 +147,7 @@ TEST_F(NativeMessagingTest, SingleSendMessageWrite) {
NativeMessageProcessHost::TYPE_SEND_MESSAGE_REQUEST, base::Bind(
&NativeMessagingTest::AcquireProcess, AsWeakPtr()),
launcher);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ASSERT_TRUE(native_message_process_host_);
EXPECT_TRUE(file_util::ContentsEqual(
@@ -164,18 +164,18 @@ TEST_F(NativeMessagingTest, DISABLED_EchoConnect) {
AsWeakPtr(), "echo.py", "{\"text\": \"Hello.\"}", 0,
NativeMessageProcessHost::TYPE_CONNECT, base::Bind(
&NativeMessagingTest::AcquireProcess, AsWeakPtr()));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ASSERT_TRUE(native_message_process_host_);
native_message_process_host_->ReadNowForTesting();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(last_posted_message_,
"{\"id\": 1, \"echo\": {\"text\": \"Hello.\"}}");
native_message_process_host_->Send("{\"foo\": \"bar\"}");
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
native_message_process_host_->ReadNowForTesting();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(last_posted_message_, "{\"id\": 2, \"echo\": {\"foo\": \"bar\"}}");
}

Powered by Google App Engine
This is Rietveld 408576698