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/base/test_data_directory.h" | 9 #include "net/base/test_data_directory.h" |
10 #include "net/cert/cert_verifier.h" | 10 #include "net/cert/cert_verifier.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 &factory_, host_port_pair_, is_https_), | 353 &factory_, host_port_pair_, is_https_), |
354 QuicStreamFactoryPeer::GetActiveSession( | 354 QuicStreamFactoryPeer::GetActiveSession( |
355 &factory_, host_port_pair_, !is_https_)); | 355 &factory_, host_port_pair_, !is_https_)); |
356 | 356 |
357 EXPECT_TRUE(socket_data1.at_read_eof()); | 357 EXPECT_TRUE(socket_data1.at_read_eof()); |
358 EXPECT_TRUE(socket_data1.at_write_eof()); | 358 EXPECT_TRUE(socket_data1.at_write_eof()); |
359 EXPECT_TRUE(socket_data2.at_read_eof()); | 359 EXPECT_TRUE(socket_data2.at_read_eof()); |
360 EXPECT_TRUE(socket_data2.at_write_eof()); | 360 EXPECT_TRUE(socket_data2.at_write_eof()); |
361 } | 361 } |
362 | 362 |
363 TEST_P(QuicStreamFactoryTest, Pooling) { | 363 // TODO(rch): re-enable this. |
| 364 TEST_P(QuicStreamFactoryTest, DISABLED_Pooling) { |
364 MockRead reads[] = { | 365 MockRead reads[] = { |
365 MockRead(ASYNC, OK, 0) // EOF | 366 MockRead(ASYNC, OK, 0) // EOF |
366 }; | 367 }; |
367 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 368 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
368 socket_factory_.AddSocketDataProvider(&socket_data); | 369 socket_factory_.AddSocketDataProvider(&socket_data); |
369 socket_data.StopAfter(1); | 370 socket_data.StopAfter(1); |
370 | 371 |
371 HostPortPair server2("mail.google.com", kDefaultServerPort); | 372 HostPortPair server2("mail.google.com", kDefaultServerPort); |
372 host_resolver_.set_synchronous_mode(true); | 373 host_resolver_.set_synchronous_mode(true); |
373 host_resolver_.rules()->AddIPLiteralRule( | 374 host_resolver_.rules()->AddIPLiteralRule( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 470 |
470 EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession( | 471 EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession( |
471 &factory_, server2, is_https_)); | 472 &factory_, server2, is_https_)); |
472 | 473 |
473 EXPECT_TRUE(socket_data1.at_read_eof()); | 474 EXPECT_TRUE(socket_data1.at_read_eof()); |
474 EXPECT_TRUE(socket_data1.at_write_eof()); | 475 EXPECT_TRUE(socket_data1.at_write_eof()); |
475 EXPECT_TRUE(socket_data2.at_read_eof()); | 476 EXPECT_TRUE(socket_data2.at_read_eof()); |
476 EXPECT_TRUE(socket_data2.at_write_eof()); | 477 EXPECT_TRUE(socket_data2.at_write_eof()); |
477 } | 478 } |
478 | 479 |
479 TEST_P(QuicStreamFactoryTest, HttpsPooling) { | 480 // TODO(rch): re-enable this. |
| 481 TEST_P(QuicStreamFactoryTest, DISABLED_HttpsPooling) { |
480 MockRead reads[] = { | 482 MockRead reads[] = { |
481 MockRead(ASYNC, OK, 0) // EOF | 483 MockRead(ASYNC, OK, 0) // EOF |
482 }; | 484 }; |
483 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 485 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
484 socket_factory_.AddSocketDataProvider(&socket_data); | 486 socket_factory_.AddSocketDataProvider(&socket_data); |
485 socket_data.StopAfter(1); | 487 socket_data.StopAfter(1); |
486 | 488 |
487 HostPortPair server1("www.example.org", 443); | 489 HostPortPair server1("www.example.org", 443); |
488 HostPortPair server2("mail.example.org", 443); | 490 HostPortPair server2("mail.example.org", 443); |
489 | 491 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 QuicCryptoClientConfig::CachedState* cached2 = | 1292 QuicCryptoClientConfig::CachedState* cached2 = |
1291 crypto_config->LookupOrCreate(server_id2); | 1293 crypto_config->LookupOrCreate(server_id2); |
1292 EXPECT_NE(cached1->source_address_token(), cached2->source_address_token()); | 1294 EXPECT_NE(cached1->source_address_token(), cached2->source_address_token()); |
1293 EXPECT_TRUE(cached2->source_address_token().empty()); | 1295 EXPECT_TRUE(cached2->source_address_token().empty()); |
1294 EXPECT_FALSE(cached2->proof_valid()); | 1296 EXPECT_FALSE(cached2->proof_valid()); |
1295 } | 1297 } |
1296 } | 1298 } |
1297 | 1299 |
1298 } // namespace test | 1300 } // namespace test |
1299 } // namespace net | 1301 } // namespace net |
OLD | NEW |