| 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 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3569 std::unique_ptr<URLRequest> r( | 3569 std::unique_ptr<URLRequest> r( |
| 3570 default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d)); | 3570 default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d)); |
| 3571 r->Start(); | 3571 r->Start(); |
| 3572 EXPECT_TRUE(r->is_pending()); | 3572 EXPECT_TRUE(r->is_pending()); |
| 3573 | 3573 |
| 3574 base::RunLoop().Run(); | 3574 base::RunLoop().Run(); |
| 3575 | 3575 |
| 3576 EXPECT_EQ(OK, d.request_status()); | 3576 EXPECT_EQ(OK, d.request_status()); |
| 3577 | 3577 |
| 3578 HttpRequestHeaders headers; | 3578 HttpRequestHeaders headers; |
| 3579 EXPECT_TRUE(r->GetFullRequestHeaders(&headers)); |
| 3579 std::string token_binding_header, token_binding_message; | 3580 std::string token_binding_header, token_binding_message; |
| 3580 EXPECT_TRUE(r->GetFullRequestHeaders(&headers)); | |
| 3581 EXPECT_TRUE(headers.GetHeader(HttpRequestHeaders::kTokenBinding, | 3581 EXPECT_TRUE(headers.GetHeader(HttpRequestHeaders::kTokenBinding, |
| 3582 &token_binding_header)); | 3582 &token_binding_header)); |
| 3583 EXPECT_TRUE(base::Base64UrlDecode( | 3583 EXPECT_TRUE(base::Base64UrlDecode( |
| 3584 token_binding_header, base::Base64UrlDecodePolicy::DISALLOW_PADDING, | 3584 token_binding_header, base::Base64UrlDecodePolicy::DISALLOW_PADDING, |
| 3585 &token_binding_message)); | 3585 &token_binding_message)); |
| 3586 std::vector<TokenBinding> token_bindings; | 3586 std::vector<TokenBinding> token_bindings; |
| 3587 ASSERT_TRUE( | 3587 ASSERT_TRUE( |
| 3588 ParseTokenBindingMessage(token_binding_message, &token_bindings)); | 3588 ParseTokenBindingMessage(token_binding_message, &token_bindings)); |
| 3589 ASSERT_EQ(1ull, token_bindings.size()); | 3589 ASSERT_EQ(1ull, token_bindings.size()); |
| 3590 | 3590 |
| (...skipping 7136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10727 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 10727 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 10728 | 10728 |
| 10729 req->Start(); | 10729 req->Start(); |
| 10730 req->Cancel(); | 10730 req->Cancel(); |
| 10731 base::RunLoop().RunUntilIdle(); | 10731 base::RunLoop().RunUntilIdle(); |
| 10732 EXPECT_EQ(ERR_ABORTED, d.request_status()); | 10732 EXPECT_EQ(ERR_ABORTED, d.request_status()); |
| 10733 EXPECT_EQ(0, d.received_redirect_count()); | 10733 EXPECT_EQ(0, d.received_redirect_count()); |
| 10734 } | 10734 } |
| 10735 | 10735 |
| 10736 } // namespace net | 10736 } // namespace net |
| OLD | NEW |