| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "net/quic/quic_session_key.h" | |
| 6 | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 | |
| 9 using std::string; | |
| 10 | |
| 11 namespace net { | |
| 12 | |
| 13 namespace { | |
| 14 | |
| 15 TEST(QuicSessionKeyTest, ToString) { | |
| 16 HostPortPair google_host_port_pair("google.com", 10); | |
| 17 | |
| 18 QuicSessionKey google_http_key(google_host_port_pair, false, | |
| 19 kPrivacyModeDisabled); | |
| 20 string google_http_key_str = google_http_key.ToString(); | |
| 21 EXPECT_EQ("http://google.com:10", google_http_key_str); | |
| 22 | |
| 23 QuicSessionKey google_https_key(google_host_port_pair, true, | |
| 24 kPrivacyModeDisabled); | |
| 25 string google_https_key_str = google_https_key.ToString(); | |
| 26 EXPECT_EQ("https://google.com:10", google_https_key_str); | |
| 27 | |
| 28 QuicSessionKey private_http_key(google_host_port_pair, false, | |
| 29 kPrivacyModeEnabled); | |
| 30 string private_http_key_str = private_http_key.ToString(); | |
| 31 EXPECT_EQ("http://google.com:10/private", private_http_key_str); | |
| 32 | |
| 33 QuicSessionKey private_https_key(google_host_port_pair, true, | |
| 34 kPrivacyModeEnabled); | |
| 35 string private_https_key_str = private_https_key.ToString(); | |
| 36 EXPECT_EQ("https://google.com:10/private", private_https_key_str); | |
| 37 } | |
| 38 | |
| 39 } // namespace | |
| 40 | |
| 41 } // namespace net | |
| OLD | NEW |