OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
8 #include "extensions/browser/api/cast_channel/cast_auth_util.h" | 8 #include "extensions/browser/api/cast_channel/cast_auth_util.h" |
9 #include "extensions/browser/api/cast_channel/logger.h" | 9 #include "extensions/browser/api/cast_channel/logger.h" |
10 #include "extensions/browser/api/cast_channel/logger_util.h" | 10 #include "extensions/browser/api/cast_channel/logger_util.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 using proto::Log; | 23 using proto::Log; |
24 using proto::SocketEvent; | 24 using proto::SocketEvent; |
25 | 25 |
26 class CastChannelLoggerTest : public testing::Test { | 26 class CastChannelLoggerTest : public testing::Test { |
27 public: | 27 public: |
28 // |logger_| will take ownership of |clock_|. | 28 // |logger_| will take ownership of |clock_|. |
29 CastChannelLoggerTest() | 29 CastChannelLoggerTest() |
30 : clock_(new base::SimpleTestTickClock), | 30 : clock_(new base::SimpleTestTickClock), |
31 logger_(new Logger(scoped_ptr<base::TickClock>(clock_), | 31 logger_(new Logger(scoped_ptr<base::TickClock>(clock_), |
32 base::TimeTicks())) {} | 32 base::TimeTicks())) {} |
33 virtual ~CastChannelLoggerTest() {} | 33 ~CastChannelLoggerTest() override {} |
34 | 34 |
35 bool Uncompress(const char* input, int length, std::string* output) { | 35 bool Uncompress(const char* input, int length, std::string* output) { |
36 z_stream stream = {0}; | 36 z_stream stream = {0}; |
37 | 37 |
38 stream.next_in = reinterpret_cast<uint8*>(const_cast<char*>(input)); | 38 stream.next_in = reinterpret_cast<uint8*>(const_cast<char*>(input)); |
39 stream.avail_in = length; | 39 stream.avail_in = length; |
40 stream.next_out = reinterpret_cast<uint8*>(&(*output)[0]); | 40 stream.next_out = reinterpret_cast<uint8*>(&(*output)[0]); |
41 stream.avail_out = output->size(); | 41 stream.avail_out = output->size(); |
42 | 42 |
43 bool success = false; | 43 bool success = false; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 log = GetLog(); | 327 log = GetLog(); |
328 ASSERT_TRUE(log.get() != NULL); | 328 ASSERT_TRUE(log.get() != NULL); |
329 | 329 |
330 EXPECT_EQ(0, log->aggregated_socket_event_size()); | 330 EXPECT_EQ(0, log->aggregated_socket_event_size()); |
331 } | 331 } |
332 | 332 |
333 } // namespace cast_channel | 333 } // namespace cast_channel |
334 } // namespace core_api | 334 } // namespace core_api |
335 } // namespace extensions | 335 } // namespace extensions |
OLD | NEW |