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

Unified Diff: components/policy/core/common/cloud/policy_header_io_helper_unittest.cc

Issue 303993005: Add browser test for ChromeResourceDispatcherHostDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix use-after-free of ResourceDispatcherHostDelegate in test. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
diff --git a/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc b/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
index b86b260eddd4275888d07252140422e233d8aee9..fdb19bdf5958e537278ecdf8add531465e3bd75f 100644
--- a/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
+++ b/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
@@ -51,14 +51,14 @@ class PolicyHeaderIOHelperTest : public testing::Test {
TEST_F(PolicyHeaderIOHelperTest, InitialHeader) {
net::TestURLRequest request(
GURL(kDMServerURL), net::DEFAULT_PRIORITY, NULL, &context_);
- helper_->AddPolicyHeaders(&request);
+ helper_->AddPolicyHeaders(request.url(), &request);
ValidateHeader(request.extra_request_headers(), kInitialPolicyHeader);
}
TEST_F(PolicyHeaderIOHelperTest, NoHeaderOnNonMatchingURL) {
net::TestURLRequest request(
GURL("http://non-matching.com"), net::DEFAULT_PRIORITY, NULL, &context_);
- helper_->AddPolicyHeaders(&request);
+ helper_->AddPolicyHeaders(request.url(), &request);
EXPECT_TRUE(request.extra_request_headers().IsEmpty());
}
@@ -68,7 +68,7 @@ TEST_F(PolicyHeaderIOHelperTest, HeaderChange) {
task_runner_->RunUntilIdle();
net::TestURLRequest request(
GURL(kDMServerURL), net::DEFAULT_PRIORITY, NULL, &context_);
- helper_->AddPolicyHeaders(&request);
+ helper_->AddPolicyHeaders(request.url(), &request);
ValidateHeader(request.extra_request_headers(), new_header);
}
@@ -77,7 +77,7 @@ TEST_F(PolicyHeaderIOHelperTest, ChangeToNoHeader) {
task_runner_->RunUntilIdle();
net::TestURLRequest request(
GURL(kDMServerURL), net::DEFAULT_PRIORITY, NULL, &context_);
- helper_->AddPolicyHeaders(&request);
+ helper_->AddPolicyHeaders(request.url(), &request);
EXPECT_TRUE(request.extra_request_headers().IsEmpty());
}

Powered by Google App Engine
This is Rietveld 408576698