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

Side by Side Diff: content/browser/loader/async_revalidation_manager_unittest.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/loader/async_revalidation_manager.h" 5 #include "content/browser/loader/async_revalidation_manager.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 DISALLOW_COPY_AND_ASSIGN(BlackholeFilter); 240 DISALLOW_COPY_AND_ASSIGN(BlackholeFilter);
241 }; 241 };
242 242
243 ResourceRequest CreateResourceRequest(const char* method, 243 ResourceRequest CreateResourceRequest(const char* method,
244 ResourceType type, 244 ResourceType type,
245 const GURL& url) { 245 const GURL& url) {
246 ResourceRequest request; 246 ResourceRequest request;
247 request.method = std::string(method); 247 request.method = std::string(method);
248 request.url = url; 248 request.url = url;
249 request.first_party_for_cookies = url; // Bypass third-party cookie blocking. 249 request.first_party_for_cookies = url; // Bypass third-party cookie blocking.
250 request.request_initiator = url::Origin(url); // Ensure initiator is set.
250 request.referrer_policy = blink::WebReferrerPolicyDefault; 251 request.referrer_policy = blink::WebReferrerPolicyDefault;
251 request.load_flags = 0; 252 request.load_flags = 0;
252 request.origin_pid = 0; 253 request.origin_pid = 0;
253 request.resource_type = type; 254 request.resource_type = type;
254 request.request_context = 0; 255 request.request_context = 0;
255 request.appcache_host_id = kAppCacheNoHostId; 256 request.appcache_host_id = kAppCacheNoHostId;
256 request.download_to_file = false; 257 request.download_to_file = false;
257 request.should_reset_appcache = false; 258 request.should_reset_appcache = false;
258 request.is_main_frame = true; 259 request.is_main_frame = true;
259 request.parent_is_main_frame = false; 260 request.parent_is_main_frame = false;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // already completed. 549 // already completed.
549 EXPECT_TRUE(NextRequestWasDestroyed()); 550 EXPECT_TRUE(NextRequestWasDestroyed());
550 551
551 // But no others. 552 // But no others.
552 EXPECT_TRUE(IsEmpty()); 553 EXPECT_TRUE(IsEmpty());
553 } 554 }
554 555
555 } // namespace 556 } // namespace
556 557
557 } // namespace content 558 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698