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

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

Issue 1085703003: Use standard ICE in Chromoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash on memory bots Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/host/session_manager_factory.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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // ownership of the HostExtensions themselves. 171 // ownership of the HostExtensions themselves.
172 std::vector<HostExtension*> extensions_; 172 std::vector<HostExtension*> extensions_;
173 173
174 // ClientSession instance under test. 174 // ClientSession instance under test.
175 scoped_ptr<ClientSession> client_session_; 175 scoped_ptr<ClientSession> client_session_;
176 176
177 // ClientSession::EventHandler mock for use in tests. 177 // ClientSession::EventHandler mock for use in tests.
178 MockClientSessionEventHandler session_event_handler_; 178 MockClientSessionEventHandler session_event_handler_;
179 179
180 // Storage for values to be returned by the protocol::Session mock. 180 // Storage for values to be returned by the protocol::Session mock.
181 SessionConfig session_config_; 181 scoped_ptr<SessionConfig> session_config_;
182 const std::string client_jid_; 182 const std::string client_jid_;
183 183
184 // Stubs returned to |client_session_| components by |connection_|. 184 // Stubs returned to |client_session_| components by |connection_|.
185 MockClientStub client_stub_; 185 MockClientStub client_stub_;
186 MockVideoStub video_stub_; 186 MockVideoStub video_stub_;
187 187
188 // DesktopEnvironment owns |input_injector_|, but input injection tests need 188 // DesktopEnvironment owns |input_injector_|, but input injection tests need
189 // to express expectations on it. 189 // to express expectations on it.
190 scoped_ptr<MockInputInjector> input_injector_; 190 scoped_ptr<MockInputInjector> input_injector_;
191 191
(...skipping 25 matching lines...) Expand all
217 void ClientSessionTest::TearDown() { 217 void ClientSessionTest::TearDown() {
218 // Clear out |task_runner_| reference so the loop can quit, and run it until 218 // Clear out |task_runner_| reference so the loop can quit, and run it until
219 // it does. 219 // it does.
220 task_runner_ = nullptr; 220 task_runner_ = nullptr;
221 run_loop_.Run(); 221 run_loop_.Run();
222 } 222 }
223 223
224 void ClientSessionTest::CreateClientSession() { 224 void ClientSessionTest::CreateClientSession() {
225 // Mock protocol::Session APIs called directly by ClientSession. 225 // Mock protocol::Session APIs called directly by ClientSession.
226 protocol::MockSession* session = new MockSession(); 226 protocol::MockSession* session = new MockSession();
227 EXPECT_CALL(*session, config()).WillRepeatedly(ReturnRef(session_config_)); 227 EXPECT_CALL(*session, config()).WillRepeatedly(ReturnRef(*session_config_));
228 EXPECT_CALL(*session, jid()).WillRepeatedly(ReturnRef(client_jid_)); 228 EXPECT_CALL(*session, jid()).WillRepeatedly(ReturnRef(client_jid_));
229 EXPECT_CALL(*session, SetEventHandler(_)); 229 EXPECT_CALL(*session, SetEventHandler(_));
230 230
231 // Mock protocol::ConnectionToClient APIs called directly by ClientSession. 231 // Mock protocol::ConnectionToClient APIs called directly by ClientSession.
232 // HostStub is not touched by ClientSession, so we can safely pass nullptr. 232 // HostStub is not touched by ClientSession, so we can safely pass nullptr.
233 scoped_ptr<MockConnectionToClient> connection( 233 scoped_ptr<MockConnectionToClient> connection(
234 new MockConnectionToClient(session, nullptr)); 234 new MockConnectionToClient(session, nullptr));
235 EXPECT_CALL(*connection, session()).WillRepeatedly(Return(session)); 235 EXPECT_CALL(*connection, session()).WillRepeatedly(Return(session));
236 EXPECT_CALL(*connection, client_stub()) 236 EXPECT_CALL(*connection, client_stub())
237 .WillRepeatedly(Return(&client_stub_)); 237 .WillRepeatedly(Return(&client_stub_));
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 767
768 DisconnectClientSession(); 768 DisconnectClientSession();
769 StopClientSession(); 769 StopClientSession();
770 770
771 // ext1 was instantiated and wrapped the video capturer. 771 // ext1 was instantiated and wrapped the video capturer.
772 EXPECT_TRUE(extension.was_instantiated()); 772 EXPECT_TRUE(extension.was_instantiated());
773 EXPECT_TRUE(extension.has_wrapped_video_capturer()); 773 EXPECT_TRUE(extension.has_wrapped_video_capturer());
774 } 774 }
775 775
776 } // namespace remoting 776 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/host/session_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698