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

Side by Side Diff: remoting/host/register_support_host_request_unittest.cc

Issue 11364031: remoting: Update calls froms 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/host_key_pair_unittest.cc ('k') | remoting/jingle_glue/iq_sender_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/register_support_host_request.h" 5 #include "remoting/host/register_support_host_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::Bind(&MockCallback::OnResponse, 83 base::Bind(&MockCallback::OnResponse,
84 base::Unretained(&callback_)))); 84 base::Unretained(&callback_))));
85 85
86 XmlElement* sent_iq = NULL; 86 XmlElement* sent_iq = NULL;
87 EXPECT_CALL(signal_strategy_, GetNextId()) 87 EXPECT_CALL(signal_strategy_, GetNextId())
88 .WillOnce(Return(kStanzaId)); 88 .WillOnce(Return(kStanzaId));
89 EXPECT_CALL(signal_strategy_, SendStanzaPtr(NotNull())) 89 EXPECT_CALL(signal_strategy_, SendStanzaPtr(NotNull()))
90 .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true))); 90 .WillOnce(DoAll(SaveArg<0>(&sent_iq), Return(true)));
91 91
92 request->OnSignalStrategyStateChange(SignalStrategy::CONNECTED); 92 request->OnSignalStrategyStateChange(SignalStrategy::CONNECTED);
93 message_loop_.RunAllPending(); 93 message_loop_.RunUntilIdle();
94 94
95 // Verify format of the query. 95 // Verify format of the query.
96 scoped_ptr<XmlElement> stanza(sent_iq); 96 scoped_ptr<XmlElement> stanza(sent_iq);
97 ASSERT_TRUE(stanza != NULL); 97 ASSERT_TRUE(stanza != NULL);
98 98
99 EXPECT_EQ(stanza->Attr(buzz::QName("", "to")), 99 EXPECT_EQ(stanza->Attr(buzz::QName("", "to")),
100 std::string(kChromotingBotJid)); 100 std::string(kChromotingBotJid));
101 EXPECT_EQ(stanza->Attr(buzz::QName("", "type")), "set"); 101 EXPECT_EQ(stanza->Attr(buzz::QName("", "type")), "set");
102 102
103 EXPECT_EQ(QName(kChromotingXmlNamespace, "register-support-host"), 103 EXPECT_EQ(QName(kChromotingXmlNamespace, "register-support-host"),
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 int consumed = 0; 148 int consumed = 0;
149 ObserverListBase<SignalStrategy::Listener>::Iterator it( 149 ObserverListBase<SignalStrategy::Listener>::Iterator it(
150 signal_strategy_listeners_); 150 signal_strategy_listeners_);
151 SignalStrategy::Listener* listener; 151 SignalStrategy::Listener* listener;
152 while ((listener = it.GetNext()) != NULL) { 152 while ((listener = it.GetNext()) != NULL) {
153 if (listener->OnSignalStrategyIncomingStanza(response.get())) 153 if (listener->OnSignalStrategyIncomingStanza(response.get()))
154 consumed++; 154 consumed++;
155 } 155 }
156 EXPECT_EQ(1, consumed); 156 EXPECT_EQ(1, consumed);
157 157
158 message_loop_.RunAllPending(); 158 message_loop_.RunUntilIdle();
159 } 159 }
160 160
161 } // namespace remoting 161 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_key_pair_unittest.cc ('k') | remoting/jingle_glue/iq_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698