OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/crypto/crypto_utils.h" | 5 #include "net/quic/crypto/crypto_utils.h" |
6 | 6 |
| 7 #include <string> |
| 8 |
7 #include "net/quic/test_tools/quic_test_utils.h" | 9 #include "net/quic/test_tools/quic_test_utils.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
9 | 11 |
| 12 using std::string; |
| 13 |
10 namespace net { | 14 namespace net { |
11 namespace test { | 15 namespace test { |
12 namespace { | 16 namespace { |
13 | 17 |
14 TEST(CryptoUtilsTest, IsValidSNI) { | 18 TEST(CryptoUtilsTest, IsValidSNI) { |
15 // IP as SNI. | 19 // IP as SNI. |
16 EXPECT_FALSE(CryptoUtils::IsValidSNI("192.168.0.1")); | 20 EXPECT_FALSE(CryptoUtils::IsValidSNI("192.168.0.1")); |
17 // SNI without any dot. | 21 // SNI without any dot. |
18 EXPECT_FALSE(CryptoUtils::IsValidSNI("somedomain")); | 22 EXPECT_FALSE(CryptoUtils::IsValidSNI("somedomain")); |
19 // Invalid RFC2396 hostname | 23 // Invalid RFC2396 hostname |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 result.length(), | 126 result.length(), |
123 expected.data(), | 127 expected.data(), |
124 expected.length()); | 128 expected.length()); |
125 } | 129 } |
126 } | 130 } |
127 } | 131 } |
128 | 132 |
129 } // namespace | 133 } // namespace |
130 } // namespace test | 134 } // namespace test |
131 } // namespace net | 135 } // namespace net |
OLD | NEW |