| 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3507 EXPECT_GT(d.bytes_received(), 0); | 3507 EXPECT_GT(d.bytes_received(), 0); |
| 3508 std::string ekm = d.data_received(); | 3508 std::string ekm = d.data_received(); |
| 3509 | 3509 |
| 3510 EXPECT_EQ(TokenBindingType::PROVIDED, token_bindings[0].type); | 3510 EXPECT_EQ(TokenBindingType::PROVIDED, token_bindings[0].type); |
| 3511 EXPECT_TRUE(VerifyEKMSignature(token_bindings[0].ec_point, | 3511 EXPECT_TRUE(VerifyEKMSignature(token_bindings[0].ec_point, |
| 3512 token_bindings[0].signature, ekm)); | 3512 token_bindings[0].signature, ekm)); |
| 3513 } | 3513 } |
| 3514 } | 3514 } |
| 3515 | 3515 |
| 3516 // Test that if a server supporting Token Binding redirects (with | 3516 // Test that if a server supporting Token Binding redirects (with |
| 3517 // Include-Referer-Token-Binding-ID) to an https url on a server that does not | 3517 // Include-Referred-Token-Binding-ID) to an https url on a server that does not |
| 3518 // support Token Binding, then we do not send a Sec-Token-Binding when following | 3518 // support Token Binding, then we do not send a Sec-Token-Binding when following |
| 3519 // the redirect. | 3519 // the redirect. |
| 3520 TEST_F(TokenBindingURLRequestTest, ForwardWithoutTokenBinding) { | 3520 TEST_F(TokenBindingURLRequestTest, ForwardWithoutTokenBinding) { |
| 3521 SpawnedTestServer::SSLOptions ssl_options; | 3521 SpawnedTestServer::SSLOptions ssl_options; |
| 3522 SpawnedTestServer https_test_server(SpawnedTestServer::TYPE_HTTPS, | 3522 SpawnedTestServer https_test_server(SpawnedTestServer::TYPE_HTTPS, |
| 3523 ssl_options, | 3523 ssl_options, |
| 3524 base::FilePath(kTestFilePath)); | 3524 base::FilePath(kTestFilePath)); |
| 3525 ASSERT_TRUE(https_test_server.Start()); | 3525 ASSERT_TRUE(https_test_server.Start()); |
| 3526 ssl_options.supported_token_binding_params.push_back(TB_PARAM_ECDSAP256); | 3526 ssl_options.supported_token_binding_params.push_back(TB_PARAM_ECDSAP256); |
| 3527 SpawnedTestServer token_binding_test_server(SpawnedTestServer::TYPE_HTTPS, | 3527 SpawnedTestServer token_binding_test_server(SpawnedTestServer::TYPE_HTTPS, |
| (...skipping 6315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9843 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 9843 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 9844 | 9844 |
| 9845 req->Start(); | 9845 req->Start(); |
| 9846 req->Cancel(); | 9846 req->Cancel(); |
| 9847 base::RunLoop().RunUntilIdle(); | 9847 base::RunLoop().RunUntilIdle(); |
| 9848 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 9848 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
| 9849 EXPECT_EQ(0, d.received_redirect_count()); | 9849 EXPECT_EQ(0, d.received_redirect_count()); |
| 9850 } | 9850 } |
| 9851 | 9851 |
| 9852 } // namespace net | 9852 } // namespace net |
| OLD | NEW |