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

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

Issue 282063005: Pull out common code from client and host versions of ServerLogEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "base/message_loop/message_loop_proxy.h" 6 #include "base/message_loop/message_loop_proxy.h"
7 #include "remoting/host/host_status_monitor_fake.h" 7 #include "remoting/host/host_status_monitor_fake.h"
8 #include "remoting/host/log_to_server.h" 8 #include "remoting/host/log_to_server.h"
9 #include "remoting/jingle_glue/mock_objects.h" 9 #include "remoting/jingle_glue/mock_objects.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } // namespace 122 } // namespace
123 123
124 class LogToServerTest : public testing::Test { 124 class LogToServerTest : public testing::Test {
125 public: 125 public:
126 LogToServerTest() {} 126 LogToServerTest() {}
127 virtual void SetUp() OVERRIDE { 127 virtual void SetUp() OVERRIDE {
128 message_loop_proxy_ = base::MessageLoopProxy::current(); 128 message_loop_proxy_ = base::MessageLoopProxy::current();
129 EXPECT_CALL(signal_strategy_, AddListener(_)); 129 EXPECT_CALL(signal_strategy_, AddListener(_));
130 log_to_server_.reset( 130 log_to_server_.reset(
131 new LogToServer(host_status_monitor_.AsWeakPtr(), 131 new LogToServer(host_status_monitor_.AsWeakPtr(),
132 ServerLogEntry::ME2ME, 132 protocol::ServerLogEntry::ME2ME,
133 &signal_strategy_, 133 &signal_strategy_,
134 kTestBotJid)); 134 kTestBotJid));
135 EXPECT_CALL(signal_strategy_, RemoveListener(_)); 135 EXPECT_CALL(signal_strategy_, RemoveListener(_));
136 } 136 }
137 137
138 protected: 138 protected:
139 base::MessageLoop message_loop_; 139 base::MessageLoop message_loop_;
140 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; 140 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
141 MockSignalStrategy signal_strategy_; 141 MockSignalStrategy signal_strategy_;
142 scoped_ptr<LogToServer> log_to_server_; 142 scoped_ptr<LogToServer> log_to_server_;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 route2.type = protocol::TransportRoute::STUN; 247 route2.type = protocol::TransportRoute::STUN;
248 log_to_server_->OnClientRouteChange(kClientJid2, "video", route2); 248 log_to_server_->OnClientRouteChange(kClientJid2, "video", route2);
249 log_to_server_->OnClientDisconnected(kClientJid1); 249 log_to_server_->OnClientDisconnected(kClientJid1);
250 log_to_server_->OnClientAuthenticated(kClientJid2); 250 log_to_server_->OnClientAuthenticated(kClientJid2);
251 log_to_server_->OnClientConnected(kClientJid2); 251 log_to_server_->OnClientConnected(kClientJid2);
252 log_to_server_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED); 252 log_to_server_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED);
253 message_loop_.Run(); 253 message_loop_.Run();
254 } 254 }
255 255
256 } // namespace remoting 256 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698