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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Issue 2555713002: Don't use FetchRequest in FrameFetchContext (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
index 9384bb5bf72f96ed55c2f067761f06f4f620fd12..d9d1801dc77a55991026c6d04a8555561fd18da6 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -444,7 +444,9 @@ class FrameFetchContextHintsTest : public FrameFetchContextTest {
resourceWidth.isSet = true;
fetchRequest.setResourceWidth(resourceWidth);
}
- fetchContext->addClientHintsIfNecessary(fetchRequest);
+ fetchContext->addClientHintsIfNecessary(
+ fetchRequest.clientHintsPreferences(), fetchRequest.getResourceWidth(),
+ fetchRequest.mutableResourceRequest());
EXPECT_EQ(isPresent ? String(headerValue) : String(),
fetchRequest.resourceRequest().httpHeaderField(headerName));
@@ -561,7 +563,7 @@ TEST_F(FrameFetchContextTest, MainResource) {
request, Resource::MainResource, FetchRequest::NoDefer));
}
-TEST_F(FrameFetchContextTest, PopulateRequestData) {
+TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) {
struct TestCase {
const char* documentURL;
bool documentSandboxed;
@@ -580,13 +582,14 @@ TEST_F(FrameFetchContextTest, PopulateRequestData) {
"http://example.test"},
// If the request already has a requestor origin, then
- // 'populateRequestData' leaves it alone:
+ // 'setFirstPartyCookieAndRequestorOrigin' leaves it alone:
{"http://example.test", false, "http://not-example.test",
WebURLRequest::FrameTypeNone, "http://not-example.test"},
{"http://example.test", true, "http://not-example.test",
WebURLRequest::FrameTypeNone, "http://not-example.test"},
- // If the request's frame type is not 'none', then 'populateRequestData'
+ // If the request's frame type is not 'none', then
+ // 'setFirstPartyCookieAndRequestorOrigin'
// leaves it alone:
{"http://example.test", false, "", WebURLRequest::FrameTypeTopLevel, ""},
{"http://example.test", false, "", WebURLRequest::FrameTypeAuxiliary, ""},
@@ -617,7 +620,7 @@ TEST_F(FrameFetchContextTest, PopulateRequestData) {
}
// Compare the populated |requestorOrigin| against |test.serializedOrigin|
- fetchContext->populateRequestData(request);
+ fetchContext->setFirstPartyCookieAndRequestorOrigin(request);
if (strlen(test.serializedOrigin) == 0) {
EXPECT_TRUE(request.requestorOrigin()->isUnique());
} else {

Powered by Google App Engine
This is Rietveld 408576698