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

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

Issue 2332023002: Correctly set requestor origin for worker initiated requests. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a5febea809251bcb9b24700ff7c7e02808cf7556..63c7b07c2033be188e69aa41bb9bb0e1c20fb366 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -453,9 +453,9 @@ TEST_F(FrameFetchContextTest, PopulateRequestData)
struct TestCase {
const char* documentURL;
bool documentSandboxed;
- const char* requestorOrigin; // "" => nullptr, "null" => unique origin
+ const char* requestorOrigin; // "" => unique origin
WebURLRequest::FrameType frameType;
- const char* serializedOrigin; // "" => nullptr, "null" => unique origin
+ const char* serializedOrigin; // "" => unique origin
} cases[] = {
// No document origin => unique request origin
{ "", false, "", WebURLRequest::FrameTypeNone, "null" },
@@ -493,14 +493,14 @@ TEST_F(FrameFetchContextTest, PopulateRequestData)
ResourceRequest request("http://example.test/");
request.setFrameType(test.frameType);
if (strlen(test.requestorOrigin) == 0)
- request.setRequestorOrigin(nullptr);
+ request.setRequestorOrigin(SecurityOrigin::createUnique());
else
request.setRequestorOrigin(SecurityOrigin::create(KURL(ParsedURLString, test.requestorOrigin)));
// Compare the populated |requestorOrigin| against |test.serializedOrigin|
fetchContext->populateRequestData(request);
if (strlen(test.serializedOrigin) == 0)
- EXPECT_EQ(nullptr, request.requestorOrigin().get());
+ EXPECT_TRUE(request.requestorOrigin()->isUnique());
else
EXPECT_EQ(String(test.serializedOrigin), request.requestorOrigin()->toString());
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698