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

Side by Side Diff: remoting/client/client_status_logger_unittest.cc

Issue 1113493005: [remoting] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 5 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
« no previous file with comments | « no previous file | remoting/host/client_session.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/client/client_status_logger.h" 5 #include "remoting/client/client_status_logger.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/message_loop/message_loop_proxy.h"
9 #include "remoting/client/chromoting_stats.h" 8 #include "remoting/client/chromoting_stats.h"
10 #include "remoting/signaling/mock_signal_strategy.h" 9 #include "remoting/signaling/mock_signal_strategy.h"
11 #include "remoting/signaling/server_log_entry_unittest.h" 10 #include "remoting/signaling/server_log_entry_unittest.h"
12 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
14 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" 13 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
15 14
16 using buzz::XmlElement; 15 using buzz::XmlElement;
17 using buzz::QName; 16 using buzz::QName;
18 using remoting::protocol::ConnectionToHost; 17 using remoting::protocol::ConnectionToHost;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 60 }
62 61
63 } // namespace 62 } // namespace
64 63
65 class ClientStatusLoggerTest : public testing::Test { 64 class ClientStatusLoggerTest : public testing::Test {
66 public: 65 public:
67 ClientStatusLoggerTest() {} 66 ClientStatusLoggerTest() {}
68 void SetUp() override { 67 void SetUp() override {
69 EXPECT_CALL(signal_strategy_, AddListener(_)); 68 EXPECT_CALL(signal_strategy_, AddListener(_));
70 EXPECT_CALL(signal_strategy_, RemoveListener(_)); 69 EXPECT_CALL(signal_strategy_, RemoveListener(_));
71 message_loop_proxy_ = base::MessageLoopProxy::current();
72 client_status_logger_.reset( 70 client_status_logger_.reset(
73 new ClientStatusLogger(ServerLogEntry::ME2ME, 71 new ClientStatusLogger(ServerLogEntry::ME2ME,
74 &signal_strategy_, 72 &signal_strategy_,
75 kTestBotJid)); 73 kTestBotJid));
76 } 74 }
77 75
78 protected: 76 protected:
79 base::MessageLoop message_loop_; 77 base::MessageLoop message_loop_;
80 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
81 MockSignalStrategy signal_strategy_; 78 MockSignalStrategy signal_strategy_;
82 scoped_ptr<ClientStatusLogger> client_status_logger_; 79 scoped_ptr<ClientStatusLogger> client_status_logger_;
83 }; 80 };
84 81
85 TEST_F(ClientStatusLoggerTest, LogStateChange) { 82 TEST_F(ClientStatusLoggerTest, LogStateChange) {
86 { 83 {
87 InSequence s; 84 InSequence s;
88 EXPECT_CALL(signal_strategy_, GetLocalJid()) 85 EXPECT_CALL(signal_strategy_, GetLocalJid())
89 .WillRepeatedly(Return(kClientJid)); 86 .WillRepeatedly(Return(kClientJid));
90 EXPECT_CALL(signal_strategy_, AddListener(_)); 87 EXPECT_CALL(signal_strategy_, AddListener(_));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 143
147 ChromotingStats stats; 144 ChromotingStats stats;
148 client_status_logger_->LogStatistics(&stats); 145 client_status_logger_->LogStatistics(&stats);
149 146
150 client_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); 147 client_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED);
151 client_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); 148 client_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED);
152 message_loop_.Run(); 149 message_loop_.Run();
153 } 150 }
154 151
155 } // namespace remoting 152 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698