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

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

Issue 2399643002: Ship Referrer-Policy header (Closed)
Patch Set: remove some more missed ShouldEnableReferrerPolicyHeader() spots Created 4 years, 2 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
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 "net/url_request/url_request_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "net/base/request_priority.h" 10 #include "net/base/request_priority.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 for (const auto& test : kTests) { 413 for (const auto& test : kTests) {
414 MockTransaction transaction; 414 MockTransaction transaction;
415 std::string request_headers = 415 std::string request_headers =
416 "Referer: " + std::string(test.original_referrer) + "\n"; 416 "Referer: " + std::string(test.original_referrer) + "\n";
417 MakeMockReferrerPolicyTransaction(test.original_url, 417 MakeMockReferrerPolicyTransaction(test.original_url,
418 request_headers.c_str(), 418 request_headers.c_str(),
419 test.response_headers, &transaction); 419 test.response_headers, &transaction);
420 420
421 MockNetworkLayer network_layer; 421 MockNetworkLayer network_layer;
422 TestURLRequestContext context; 422 TestURLRequestContext context;
423 context.set_enable_referrer_policy_header(true);
424 context.set_http_transaction_factory(&network_layer); 423 context.set_http_transaction_factory(&network_layer);
425 424
426 TestDelegate d; 425 TestDelegate d;
427 std::unique_ptr<URLRequest> req( 426 std::unique_ptr<URLRequest> req(
428 context.CreateRequest(GURL(transaction.url), DEFAULT_PRIORITY, &d)); 427 context.CreateRequest(GURL(transaction.url), DEFAULT_PRIORITY, &d));
429 AddMockTransaction(&transaction); 428 AddMockTransaction(&transaction);
430 429
431 req->set_referrer_policy(test.original_referrer_policy); 430 req->set_referrer_policy(test.original_referrer_policy);
432 req->SetReferrer(test.original_referrer); 431 req->SetReferrer(test.original_referrer);
433 432
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 563
565 EXPECT_FALSE(d.request_failed()); 564 EXPECT_FALSE(d.request_failed());
566 EXPECT_EQ(200, req->GetResponseCode()); 565 EXPECT_EQ(200, req->GetResponseCode());
567 EXPECT_EQ(kBrotliDecodedHelloData, d.data_received()); 566 EXPECT_EQ(kBrotliDecodedHelloData, d.data_received());
568 EXPECT_TRUE(network_layer.done_reading_called()); 567 EXPECT_TRUE(network_layer.done_reading_called());
569 568
570 RemoveMockTransaction(&kBrotli_Slow_Transaction); 569 RemoveMockTransaction(&kBrotli_Slow_Transaction);
571 } 570 }
572 571
573 } // namespace net 572 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_job.cc ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698