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

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

Issue 2519473002: Fixes the cache lock issue. (Closed)
Patch Set: Initial patch Created 4 years 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
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 3541 matching lines...) Expand 10 before | Expand all | Expand 10 after
3552 std::unique_ptr<URLRequest> r( 3552 std::unique_ptr<URLRequest> r(
3553 default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d)); 3553 default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
3554 r->Start(); 3554 r->Start();
3555 EXPECT_TRUE(r->is_pending()); 3555 EXPECT_TRUE(r->is_pending());
3556 3556
3557 base::RunLoop().Run(); 3557 base::RunLoop().Run();
3558 3558
3559 EXPECT_EQ(OK, d.request_status()); 3559 EXPECT_EQ(OK, d.request_status());
3560 3560
3561 HttpRequestHeaders headers; 3561 HttpRequestHeaders headers;
3562 EXPECT_TRUE(r->GetFullRequestHeaders(&headers));
3562 std::string token_binding_header, token_binding_message; 3563 std::string token_binding_header, token_binding_message;
3563 EXPECT_TRUE(r->GetFullRequestHeaders(&headers));
3564 EXPECT_TRUE(headers.GetHeader(HttpRequestHeaders::kTokenBinding, 3564 EXPECT_TRUE(headers.GetHeader(HttpRequestHeaders::kTokenBinding,
3565 &token_binding_header)); 3565 &token_binding_header));
3566 EXPECT_TRUE(base::Base64UrlDecode( 3566 EXPECT_TRUE(base::Base64UrlDecode(
3567 token_binding_header, base::Base64UrlDecodePolicy::DISALLOW_PADDING, 3567 token_binding_header, base::Base64UrlDecodePolicy::DISALLOW_PADDING,
3568 &token_binding_message)); 3568 &token_binding_message));
3569 std::vector<TokenBinding> token_bindings; 3569 std::vector<TokenBinding> token_bindings;
3570 ASSERT_TRUE( 3570 ASSERT_TRUE(
3571 ParseTokenBindingMessage(token_binding_message, &token_bindings)); 3571 ParseTokenBindingMessage(token_binding_message, &token_bindings));
3572 ASSERT_EQ(1ull, token_bindings.size()); 3572 ASSERT_EQ(1ull, token_bindings.size());
3573 3573
(...skipping 7040 matching lines...) Expand 10 before | Expand all | Expand 10 after
10614 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10614 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10615 10615
10616 req->Start(); 10616 req->Start();
10617 req->Cancel(); 10617 req->Cancel();
10618 base::RunLoop().RunUntilIdle(); 10618 base::RunLoop().RunUntilIdle();
10619 EXPECT_EQ(ERR_ABORTED, d.request_status()); 10619 EXPECT_EQ(ERR_ABORTED, d.request_status());
10620 EXPECT_EQ(0, d.received_redirect_count()); 10620 EXPECT_EQ(0, d.received_redirect_count());
10621 } 10621 }
10622 10622
10623 } // namespace net 10623 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698