| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "extensions/browser/api/cast_channel/cast_auth_util.h" | 10 #include "components/cast_channel/cast_auth_util.h" |
| 11 #include "extensions/browser/api/cast_channel/logger.h" | 11 #include "components/cast_channel/logger.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace extensions { | |
| 16 namespace api { | |
| 17 namespace cast_channel { | 15 namespace cast_channel { |
| 18 | 16 |
| 19 using proto::EventType; | 17 using proto::EventType; |
| 20 using proto::Log; | 18 using proto::Log; |
| 21 using proto::SocketEvent; | 19 using proto::SocketEvent; |
| 22 | 20 |
| 23 TEST(CastChannelLoggerTest, LogLastErrorEvents) { | 21 TEST(CastChannelLoggerTest, LogLastErrorEvents) { |
| 24 scoped_refptr<Logger> logger(new Logger()); | 22 scoped_refptr<Logger> logger(new Logger()); |
| 25 | 23 |
| 26 // Net return value is set to an error | 24 // Net return value is set to an error |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 58 |
| 61 // Logging a non-error event does not change the LastErrors for the channel. | 59 // Logging a non-error event does not change the LastErrors for the channel. |
| 62 logger->LogSocketEventWithRv(3, EventType::TCP_SOCKET_CONNECT, net::OK); | 60 logger->LogSocketEventWithRv(3, EventType::TCP_SOCKET_CONNECT, net::OK); |
| 63 last_errors = logger->GetLastErrors(3); | 61 last_errors = logger->GetLastErrors(3); |
| 64 EXPECT_EQ(last_errors.event_type, proto::AUTH_CHALLENGE_REPLY); | 62 EXPECT_EQ(last_errors.event_type, proto::AUTH_CHALLENGE_REPLY); |
| 65 EXPECT_EQ(last_errors.challenge_reply_error_type, | 63 EXPECT_EQ(last_errors.challenge_reply_error_type, |
| 66 proto::CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE); | 64 proto::CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE); |
| 67 } | 65 } |
| 68 | 66 |
| 69 } // namespace cast_channel | 67 } // namespace cast_channel |
| 70 } // namespace api | |
| 71 } // namespace extensions | |
| OLD | NEW |