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/quic_stream_factory.h" | 5 #include "net/quic/quic_stream_factory.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "net/cert/cert_verifier.h" | 9 #include "net/cert/cert_verifier.h" |
10 #include "net/dns/mock_host_resolver.h" | 10 #include "net/dns/mock_host_resolver.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 EXPECT_EQ(OK, callback_.WaitForResult()); | 373 EXPECT_EQ(OK, callback_.WaitForResult()); |
374 stream = request2.ReleaseStream(); | 374 stream = request2.ReleaseStream(); |
375 stream.reset(); // Will reset stream 3. | 375 stream.reset(); // Will reset stream 3. |
376 | 376 |
377 EXPECT_TRUE(socket_data.at_read_eof()); | 377 EXPECT_TRUE(socket_data.at_read_eof()); |
378 EXPECT_TRUE(socket_data.at_write_eof()); | 378 EXPECT_TRUE(socket_data.at_write_eof()); |
379 EXPECT_TRUE(socket_data2.at_read_eof()); | 379 EXPECT_TRUE(socket_data2.at_read_eof()); |
380 EXPECT_TRUE(socket_data2.at_write_eof()); | 380 EXPECT_TRUE(socket_data2.at_write_eof()); |
381 } | 381 } |
382 | 382 |
383 TEST_F(QuicStreamFactoryTest, SharedCryptoConfig) { | 383 TEST_F(QuicStreamFactoryTest, DISABLED_SharedCryptoConfig) { |
384 HostPortProxyPair host_port_proxy_pair1(HostPortPair("r1.c.youtube.com", 80), | 384 HostPortProxyPair host_port_proxy_pair1(HostPortPair("r1.c.youtube.com", 80), |
385 ProxyServer::Direct()); | 385 ProxyServer::Direct()); |
386 | 386 |
387 QuicCryptoClientConfig* crypto_config1 = | 387 QuicCryptoClientConfig* crypto_config1 = |
388 QuicStreamFactoryPeer::GetOrCreateCryptoConfig(&factory_, | 388 QuicStreamFactoryPeer::GetOrCreateCryptoConfig(&factory_, |
389 host_port_proxy_pair1); | 389 host_port_proxy_pair1); |
390 DCHECK(crypto_config1); | 390 DCHECK(crypto_config1); |
391 QuicCryptoClientConfig::CachedState* cached1 = | 391 QuicCryptoClientConfig::CachedState* cached1 = |
392 crypto_config1->LookupOrCreate(host_port_proxy_pair1.first.host()); | 392 crypto_config1->LookupOrCreate(host_port_proxy_pair1.first.host()); |
393 // Mutate the cached1 to have different data. | 393 // Mutate the cached1 to have different data. |
394 // TODO(rtenneti): mutate other members of CachedState. | 394 // TODO(rtenneti): mutate other members of CachedState. |
395 cached1->set_source_address_token("c.youtube.com"); | 395 cached1->set_source_address_token("c.youtube.com"); |
396 | 396 |
397 HostPortProxyPair host_port_proxy_pair2(HostPortPair("r2.c.youtube.com", 80), | 397 HostPortProxyPair host_port_proxy_pair2(HostPortPair("r2.c.youtube.com", 80), |
398 ProxyServer::Direct()); | 398 ProxyServer::Direct()); |
399 QuicCryptoClientConfig* crypto_config2 = | 399 QuicCryptoClientConfig* crypto_config2 = |
400 QuicStreamFactoryPeer::GetOrCreateCryptoConfig(&factory_, | 400 QuicStreamFactoryPeer::GetOrCreateCryptoConfig(&factory_, |
401 host_port_proxy_pair2); | 401 host_port_proxy_pair2); |
402 DCHECK(crypto_config2); | 402 DCHECK(crypto_config2); |
403 QuicCryptoClientConfig::CachedState* cached2 = | 403 QuicCryptoClientConfig::CachedState* cached2 = |
404 crypto_config2->LookupOrCreate(host_port_proxy_pair2.first.host()); | 404 crypto_config2->LookupOrCreate(host_port_proxy_pair2.first.host()); |
405 EXPECT_EQ(cached1->source_address_token(), cached2->source_address_token()); | 405 EXPECT_EQ(cached1->source_address_token(), cached2->source_address_token()); |
406 } | 406 } |
407 | 407 |
408 } // namespace test | 408 } // namespace test |
409 } // namespace net | 409 } // namespace net |
OLD | NEW |