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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2395 data.set_connect_data(connect_data); | 2395 data.set_connect_data(connect_data); |
2396 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); | 2396 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); |
2397 | 2397 |
2398 // Load a cert that is valid for: | 2398 // Load a cert that is valid for: |
2399 // www.example.org | 2399 // www.example.org |
2400 // mail.example.org | 2400 // mail.example.org |
2401 // www.example.com | 2401 // www.example.com |
2402 base::FilePath certs_dir = GetTestCertsDirectory(); | 2402 base::FilePath certs_dir = GetTestCertsDirectory(); |
2403 scoped_refptr<X509Certificate> test_cert( | 2403 scoped_refptr<X509Certificate> test_cert( |
2404 ImportCertFromFile(certs_dir, "spdy_pooling.pem")); | 2404 ImportCertFromFile(certs_dir, "spdy_pooling.pem")); |
2405 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); | 2405 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert.get()); |
2406 | 2406 |
2407 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 2407 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
2408 ssl.cert = test_cert; | 2408 ssl.cert = test_cert; |
2409 session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl); | 2409 session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl); |
2410 | 2410 |
2411 CreateDeterministicNetworkSession(); | 2411 CreateDeterministicNetworkSession(); |
2412 | 2412 |
2413 base::WeakPtr<SpdySession> session = | 2413 base::WeakPtr<SpdySession> session = |
2414 CreateSecureSpdySession(http_session_, key_, BoundNetLog()); | 2414 CreateSecureSpdySession(http_session_, key_, BoundNetLog()); |
2415 | 2415 |
(...skipping 21 matching lines...) Expand all Loading... |
2437 data.set_connect_data(connect_data); | 2437 data.set_connect_data(connect_data); |
2438 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); | 2438 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); |
2439 | 2439 |
2440 // Load a cert that is valid for: | 2440 // Load a cert that is valid for: |
2441 // www.example.org | 2441 // www.example.org |
2442 // mail.example.org | 2442 // mail.example.org |
2443 // www.example.com | 2443 // www.example.com |
2444 base::FilePath certs_dir = GetTestCertsDirectory(); | 2444 base::FilePath certs_dir = GetTestCertsDirectory(); |
2445 scoped_refptr<X509Certificate> test_cert( | 2445 scoped_refptr<X509Certificate> test_cert( |
2446 ImportCertFromFile(certs_dir, "spdy_pooling.pem")); | 2446 ImportCertFromFile(certs_dir, "spdy_pooling.pem")); |
2447 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); | 2447 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert.get()); |
2448 | 2448 |
2449 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 2449 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
2450 ssl.channel_id_sent = true; | 2450 ssl.channel_id_sent = true; |
2451 ssl.cert = test_cert; | 2451 ssl.cert = test_cert; |
2452 session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl); | 2452 session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl); |
2453 | 2453 |
2454 CreateDeterministicNetworkSession(); | 2454 CreateDeterministicNetworkSession(); |
2455 | 2455 |
2456 base::WeakPtr<SpdySession> session = | 2456 base::WeakPtr<SpdySession> session = |
2457 CreateSecureSpdySession(http_session_, key_, BoundNetLog()); | 2457 CreateSecureSpdySession(http_session_, key_, BoundNetLog()); |
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5127 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), | 5127 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), |
5128 "spdy_pooling.pem"); | 5128 "spdy_pooling.pem"); |
5129 ssl_info.is_issued_by_known_root = true; | 5129 ssl_info.is_issued_by_known_root = true; |
5130 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); | 5130 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); |
5131 | 5131 |
5132 EXPECT_TRUE(SpdySession::CanPool( | 5132 EXPECT_TRUE(SpdySession::CanPool( |
5133 &tss, ssl_info, "www.example.org", "mail.example.org")); | 5133 &tss, ssl_info, "www.example.org", "mail.example.org")); |
5134 } | 5134 } |
5135 | 5135 |
5136 } // namespace net | 5136 } // namespace net |
OLD | NEW |