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

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

Issue 2918653004: Remove dup'ed code for RequestorOrigin and FirstPartyCookie (Closed)
Patch Set: . Created 3 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: 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 1d81f49fd63b2ed10497b0a2ffa5530d2d9d0fc3..4e22089ff65fe2d18c32ba26a4456ced89d8eb8c 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -768,9 +768,9 @@ TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) {
struct TestCase {
const char* document_url;
bool document_sandboxed;
- const char* requestor_origin; // "" => unique origin
+ const char* requestor_origin; // "" => null
WebURLRequest::FrameType frame_type;
- const char* serialized_origin; // "" => unique origin
+ const char* serialized_origin; // "" => null
} cases[] = {
// No document origin => unique request origin
{"", false, "", WebURLRequest::kFrameTypeNone, "null"},
@@ -783,24 +783,17 @@ TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) {
"http://example.test"},
// If the request already has a requestor origin, then
- // 'setFirstPartyCookieAndRequestorOrigin' leaves it alone:
+ // 'SetFirstPartyCookieAndRequestorOrigin' leaves it alone:
{"http://example.test", false, "http://not-example.test",
WebURLRequest::kFrameTypeNone, "http://not-example.test"},
{"http://example.test", true, "http://not-example.test",
WebURLRequest::kFrameTypeNone, "http://not-example.test"},
-
- // If the request's frame type is not 'none', then
- // 'setFirstPartyCookieAndRequestorOrigin'
- // leaves it alone:
- {"http://example.test", false, "", WebURLRequest::kFrameTypeTopLevel, ""},
- {"http://example.test", false, "", WebURLRequest::kFrameTypeAuxiliary,
- ""},
- {"http://example.test", false, "", WebURLRequest::kFrameTypeNested, ""},
};
+ int index = 0;
for (const auto& test : cases) {
- SCOPED_TRACE(::testing::Message()
- << test.document_url << " => " << test.serialized_origin);
+ SCOPED_TRACE(::testing::Message() << index++ << " " << test.document_url
+ << " => " << test.serialized_origin);
// Set up a new document to ensure sandbox flags are cleared:
dummy_page_holder = DummyPageHolder::Create(IntSize(500, 500));
dummy_page_holder->GetPage().SetDeviceScaleFactorDeprecated(1.0);
@@ -824,7 +817,7 @@ TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) {
// Compare the populated |requestorOrigin| against |test.serializedOrigin|
fetch_context->SetFirstPartyCookieAndRequestorOrigin(request);
if (strlen(test.serialized_origin) == 0) {
- EXPECT_TRUE(request.RequestorOrigin()->IsUnique());
+ EXPECT_TRUE(!request.RequestorOrigin());
} else {
EXPECT_EQ(String(test.serialized_origin),
request.RequestorOrigin()->ToString());

Powered by Google App Engine
This is Rietveld 408576698