OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_telemetry_logger.h" | 5 #include "remoting/client/client_telemetry_logger.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/message_loop/message_loop.h" | |
12 #include "base/threading/thread_task_runner_handle.h" | |
13 #include "remoting/protocol/connection_to_host.h" | 11 #include "remoting/protocol/connection_to_host.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
15 | 13 |
16 namespace { | 14 namespace { |
17 | 15 |
18 // Returns true if |actual| has all fields that |expected| has and the values | 16 // Returns true if |actual| has all fields that |expected| has and the values |
19 // also match. |actual| can have fields that |expected| doesn't have but not the | 17 // also match. |actual| can have fields that |expected| doesn't have but not the |
20 // other way around. | 18 // other way around. |
21 static bool Contains(const remoting::ChromotingEvent& actual, | 19 static bool Contains(const remoting::ChromotingEvent& actual, |
22 const remoting::ChromotingEvent& expected) { | 20 const remoting::ChromotingEvent& expected) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 TEST_F(ClientTelemetryLoggerTest, PassesThroughAuthTokenAndClosure) { | 177 TEST_F(ClientTelemetryLoggerTest, PassesThroughAuthTokenAndClosure) { |
180 std::string token("some token"); | 178 std::string token("some token"); |
181 base::Closure closure = base::Bind(&base::DoNothing); | 179 base::Closure closure = base::Bind(&base::DoNothing); |
182 logger_->SetAuthToken(token); | 180 logger_->SetAuthToken(token); |
183 logger_->SetAuthClosure(closure); | 181 logger_->SetAuthClosure(closure); |
184 EXPECT_EQ(token, log_writer_->auth_token()); | 182 EXPECT_EQ(token, log_writer_->auth_token()); |
185 EXPECT_TRUE(closure.Equals(log_writer_->auth_closure())); | 183 EXPECT_TRUE(closure.Equals(log_writer_->auth_closure())); |
186 } | 184 } |
187 | 185 |
188 } // namespace remoting | 186 } // namespace remoting |
OLD | NEW |