| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 OrderedSocketData data2(reads2, arraysize(reads2), | 2481 OrderedSocketData data2(reads2, arraysize(reads2), |
| 2482 writes2, arraysize(writes2)); | 2482 writes2, arraysize(writes2)); |
| 2483 | 2483 |
| 2484 // TODO(erikchen): Make test support SPDYSSL, SPDYNPN | 2484 // TODO(erikchen): Make test support SPDYSSL, SPDYNPN |
| 2485 TestDelegate d; | 2485 TestDelegate d; |
| 2486 { | 2486 { |
| 2487 SpdyURLRequestContext spdy_url_request_context( | 2487 SpdyURLRequestContext spdy_url_request_context( |
| 2488 GetParam().protocol, | 2488 GetParam().protocol, |
| 2489 false /* force_spdy_over_ssl*/, | 2489 false /* force_spdy_over_ssl*/, |
| 2490 true /* force_spdy_always */); | 2490 true /* force_spdy_always */); |
| 2491 scoped_ptr<URLRequest> r( | 2491 scoped_ptr<URLRequest> r(spdy_url_request_context.CreateRequest( |
| 2492 spdy_url_request_context.CreateRequest(GURL("http://www.google.com/"), | 2492 GURL("http://www.google.com/"), DEFAULT_PRIORITY, &d)); |
| 2493 DEFAULT_PRIORITY, | |
| 2494 &d, | |
| 2495 NULL)); | |
| 2496 spdy_url_request_context.socket_factory(). | 2493 spdy_url_request_context.socket_factory(). |
| 2497 AddSocketDataProvider(&data); | 2494 AddSocketDataProvider(&data); |
| 2498 spdy_url_request_context.socket_factory(). | 2495 spdy_url_request_context.socket_factory(). |
| 2499 AddSocketDataProvider(&data2); | 2496 AddSocketDataProvider(&data2); |
| 2500 | 2497 |
| 2501 d.set_quit_on_redirect(true); | 2498 d.set_quit_on_redirect(true); |
| 2502 r->Start(); | 2499 r->Start(); |
| 2503 base::RunLoop().Run(); | 2500 base::RunLoop().Run(); |
| 2504 | 2501 |
| 2505 EXPECT_EQ(1, d.received_redirect_count()); | 2502 EXPECT_EQ(1, d.received_redirect_count()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 writes2, arraysize(writes2)); | 2573 writes2, arraysize(writes2)); |
| 2577 | 2574 |
| 2578 // TODO(erikchen): Make test support SPDYSSL, SPDYNPN | 2575 // TODO(erikchen): Make test support SPDYSSL, SPDYNPN |
| 2579 TestDelegate d; | 2576 TestDelegate d; |
| 2580 TestDelegate d2; | 2577 TestDelegate d2; |
| 2581 SpdyURLRequestContext spdy_url_request_context( | 2578 SpdyURLRequestContext spdy_url_request_context( |
| 2582 GetParam().protocol, | 2579 GetParam().protocol, |
| 2583 false /* force_spdy_over_ssl*/, | 2580 false /* force_spdy_over_ssl*/, |
| 2584 true /* force_spdy_always */); | 2581 true /* force_spdy_always */); |
| 2585 { | 2582 { |
| 2586 scoped_ptr<URLRequest> r( | 2583 scoped_ptr<URLRequest> r(spdy_url_request_context.CreateRequest( |
| 2587 spdy_url_request_context.CreateRequest(GURL("http://www.google.com/"), | 2584 GURL("http://www.google.com/"), DEFAULT_PRIORITY, &d)); |
| 2588 DEFAULT_PRIORITY, | |
| 2589 &d, | |
| 2590 NULL)); | |
| 2591 spdy_url_request_context.socket_factory(). | 2585 spdy_url_request_context.socket_factory(). |
| 2592 AddSocketDataProvider(&data); | 2586 AddSocketDataProvider(&data); |
| 2593 | 2587 |
| 2594 r->Start(); | 2588 r->Start(); |
| 2595 base::RunLoop().Run(); | 2589 base::RunLoop().Run(); |
| 2596 | 2590 |
| 2597 EXPECT_EQ(0, d.received_redirect_count()); | 2591 EXPECT_EQ(0, d.received_redirect_count()); |
| 2598 std::string contents("hello!"); | 2592 std::string contents("hello!"); |
| 2599 EXPECT_EQ(contents, d.data_received()); | 2593 EXPECT_EQ(contents, d.data_received()); |
| 2600 | 2594 |
| 2601 scoped_ptr<URLRequest> r2( | 2595 scoped_ptr<URLRequest> r2(spdy_url_request_context.CreateRequest( |
| 2602 spdy_url_request_context.CreateRequest( | 2596 GURL("http://www.google.com/foo.dat"), DEFAULT_PRIORITY, &d2)); |
| 2603 GURL("http://www.google.com/foo.dat"), | |
| 2604 DEFAULT_PRIORITY, | |
| 2605 &d2, | |
| 2606 NULL)); | |
| 2607 spdy_url_request_context.socket_factory(). | 2597 spdy_url_request_context.socket_factory(). |
| 2608 AddSocketDataProvider(&data2); | 2598 AddSocketDataProvider(&data2); |
| 2609 | 2599 |
| 2610 d2.set_quit_on_redirect(true); | 2600 d2.set_quit_on_redirect(true); |
| 2611 r2->Start(); | 2601 r2->Start(); |
| 2612 base::RunLoop().Run(); | 2602 base::RunLoop().Run(); |
| 2613 EXPECT_EQ(1, d2.received_redirect_count()); | 2603 EXPECT_EQ(1, d2.received_redirect_count()); |
| 2614 | 2604 |
| 2615 r2->FollowDeferredRedirect(); | 2605 r2->FollowDeferredRedirect(); |
| 2616 base::RunLoop().Run(); | 2606 base::RunLoop().Run(); |
| (...skipping 4205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6822 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6812 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6823 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6813 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6824 new SSLSocketDataProvider(ASYNC, OK)); | 6814 new SSLSocketDataProvider(ASYNC, OK)); |
| 6825 // Set to TLS_RSA_WITH_NULL_MD5 | 6815 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6826 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6816 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6827 | 6817 |
| 6828 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6818 RunTLSUsageCheckTest(ssl_provider.Pass()); |
| 6829 } | 6819 } |
| 6830 | 6820 |
| 6831 } // namespace net | 6821 } // namespace net |
| OLD | NEW |