Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 2137193002: Update token binding code to latest drafts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary cast Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_job.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/url_request/url_request_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698