| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromium/quic_stream_factory.h" | 5 #include "net/quic/chromium/quic_stream_factory.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 5196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5207 | 5207 |
| 5208 QuicServerId server_id; | 5208 QuicServerId server_id; |
| 5209 QuicCryptoClientConfig::CachedState* state; | 5209 QuicCryptoClientConfig::CachedState* state; |
| 5210 } test_cases[] = { | 5210 } test_cases[] = { |
| 5211 TestCase("www.google.com", 443, privacy_mode_, crypto_config), | 5211 TestCase("www.google.com", 443, privacy_mode_, crypto_config), |
| 5212 TestCase("www.example.com", 443, privacy_mode_, crypto_config), | 5212 TestCase("www.example.com", 443, privacy_mode_, crypto_config), |
| 5213 TestCase("www.example.com", 4433, privacy_mode_, crypto_config)}; | 5213 TestCase("www.example.com", 4433, privacy_mode_, crypto_config)}; |
| 5214 | 5214 |
| 5215 // Clear cached states for the origin https://www.example.com:4433. | 5215 // Clear cached states for the origin https://www.example.com:4433. |
| 5216 GURL origin("https://www.example.com:4433"); | 5216 GURL origin("https://www.example.com:4433"); |
| 5217 factory_->ClearCachedStatesInCryptoConfig( | 5217 factory_->ClearCachedStatesInCryptoConfig(base::Bind( |
| 5218 base::Bind(&GURL::operator==, base::Unretained(&origin))); | 5218 static_cast<bool (*)(const GURL&, const GURL&)>(::operator==), origin)); |
| 5219 EXPECT_FALSE(test_cases[0].state->certs().empty()); | 5219 EXPECT_FALSE(test_cases[0].state->certs().empty()); |
| 5220 EXPECT_FALSE(test_cases[1].state->certs().empty()); | 5220 EXPECT_FALSE(test_cases[1].state->certs().empty()); |
| 5221 EXPECT_TRUE(test_cases[2].state->certs().empty()); | 5221 EXPECT_TRUE(test_cases[2].state->certs().empty()); |
| 5222 | 5222 |
| 5223 // Clear all cached states. | 5223 // Clear all cached states. |
| 5224 factory_->ClearCachedStatesInCryptoConfig( | 5224 factory_->ClearCachedStatesInCryptoConfig( |
| 5225 base::Callback<bool(const GURL&)>()); | 5225 base::Callback<bool(const GURL&)>()); |
| 5226 EXPECT_TRUE(test_cases[0].state->certs().empty()); | 5226 EXPECT_TRUE(test_cases[0].state->certs().empty()); |
| 5227 EXPECT_TRUE(test_cases[1].state->certs().empty()); | 5227 EXPECT_TRUE(test_cases[1].state->certs().empty()); |
| 5228 EXPECT_TRUE(test_cases[2].state->certs().empty()); | 5228 EXPECT_TRUE(test_cases[2].state->certs().empty()); |
| 5229 } | 5229 } |
| 5230 | 5230 |
| 5231 } // namespace test | 5231 } // namespace test |
| 5232 } // namespace net | 5232 } // namespace net |
| OLD | NEW |