| 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 "net/quic/quic_socket_address_coder.h" | 5 #include "net/quic/quic_socket_address_coder.h" |
| 6 | 6 |
| 7 #include "net/base/net_util.h" |
| 8 #include "net/base/sys_addrinfo.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 10 |
| 9 using std::string; | 11 using std::string; |
| 10 | 12 |
| 11 namespace net { | 13 namespace net { |
| 12 namespace test { | 14 namespace test { |
| 13 | 15 |
| 14 TEST(QuicSocketAddressCoderTest, EncodeIPv4) { | 16 TEST(QuicSocketAddressCoderTest, EncodeIPv4) { |
| 15 IPAddressNumber ip; | 17 IPAddressNumber ip; |
| 16 ASSERT_TRUE(ParseIPLiteralToNumber("4.31.198.44", &ip)); | 18 ASSERT_TRUE(ParseIPLiteralToNumber("4.31.198.44", &ip)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 110 |
| 109 QuicSocketAddressCoder decoder; | 111 QuicSocketAddressCoder decoder; |
| 110 ASSERT_TRUE(decoder.Decode(serialized.data(), serialized.length())); | 112 ASSERT_TRUE(decoder.Decode(serialized.data(), serialized.length())); |
| 111 EXPECT_EQ(encoder.ip(), decoder.ip()); | 113 EXPECT_EQ(encoder.ip(), decoder.ip()); |
| 112 EXPECT_EQ(encoder.port(), decoder.port()); | 114 EXPECT_EQ(encoder.port(), decoder.port()); |
| 113 } | 115 } |
| 114 } | 116 } |
| 115 | 117 |
| 116 } // namespace test | 118 } // namespace test |
| 117 } // namespace net | 119 } // namespace net |
| OLD | NEW |