| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chromeos/components/tether/message_wrapper.h" | 5 #include "chromeos/components/tether/message_wrapper.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 MessageType::DISCONNECT_TETHERING_REQUEST); | 96 MessageType::DISCONNECT_TETHERING_REQUEST); |
| 97 } | 97 } |
| 98 | 98 |
| 99 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_KeepAliveTickle) { | 99 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_KeepAliveTickle) { |
| 100 KeepAliveTickle tickle; | 100 KeepAliveTickle tickle; |
| 101 | 101 |
| 102 MessageWrapper wrapper(tickle); | 102 MessageWrapper wrapper(tickle); |
| 103 VerifyProtoConversion(&tickle, wrapper, MessageType::KEEP_ALIVE_TICKLE); | 103 VerifyProtoConversion(&tickle, wrapper, MessageType::KEEP_ALIVE_TICKLE); |
| 104 } | 104 } |
| 105 | 105 |
| 106 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_KeepAliveTickleResponse) { |
| 107 KeepAliveTickleResponse response; |
| 108 |
| 109 MessageWrapper wrapper(response); |
| 110 VerifyProtoConversion(&response, wrapper, |
| 111 MessageType::KEEP_ALIVE_TICKLE_RESPONSE); |
| 112 } |
| 113 |
| 106 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_TetherAvailabilityRequest) { | 114 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_TetherAvailabilityRequest) { |
| 107 TetherAvailabilityRequest request; | 115 TetherAvailabilityRequest request; |
| 108 | 116 |
| 109 MessageWrapper wrapper(request); | 117 MessageWrapper wrapper(request); |
| 110 VerifyProtoConversion(&request, wrapper, | 118 VerifyProtoConversion(&request, wrapper, |
| 111 MessageType::TETHER_AVAILABILITY_REQUEST); | 119 MessageType::TETHER_AVAILABILITY_REQUEST); |
| 112 } | 120 } |
| 113 | 121 |
| 114 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_TetherAvailabilityResponse) { | 122 TEST_F(MessageWrapperTest, TestToAndFromRawMessage_TetherAvailabilityResponse) { |
| 115 TetherAvailabilityResponse response = CreateTetherAvailabilityResponse(); | 123 TetherAvailabilityResponse response = CreateTetherAvailabilityResponse(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 EXPECT_TRUE(wrapper); | 197 EXPECT_TRUE(wrapper); |
| 190 EXPECT_EQ(MessageType::TETHER_AVAILABILITY_RESPONSE, | 198 EXPECT_EQ(MessageType::TETHER_AVAILABILITY_RESPONSE, |
| 191 wrapper->GetMessageType()); | 199 wrapper->GetMessageType()); |
| 192 EXPECT_EQ(response.SerializeAsString(), | 200 EXPECT_EQ(response.SerializeAsString(), |
| 193 wrapper->GetProto()->SerializeAsString()); | 201 wrapper->GetProto()->SerializeAsString()); |
| 194 } | 202 } |
| 195 | 203 |
| 196 } // namespace tether | 204 } // namespace tether |
| 197 | 205 |
| 198 } // namespace cryptauth | 206 } // namespace cryptauth |
| OLD | NEW |