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

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

Issue 2323143002: Correctly set requestor origin for worker initiated requests. (Closed)
Patch Set: rebase 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 9c6045bd1a4c2606bb8270f3b9ff274a98da856e..9bfc1b0d6a358d2afddf45b71d395c386ecb7b62 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -445,9 +445,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" },
@@ -485,14 +485,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_FALSE(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