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