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

Unified Diff: third_party/WebKit/Source/modules/fetch/RequestTest.cpp

Issue 1391583002: Introduce "navigate" mode in Requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/fetch/RequestTest.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/RequestTest.cpp b/third_party/WebKit/Source/modules/fetch/RequestTest.cpp
index 0300d0945221ad8fc7a671d11caecb4e3a1ffa50..0c6fed467f3a947180208a17c16de4826a1d3af9 100644
--- a/third_party/WebKit/Source/modules/fetch/RequestTest.cpp
+++ b/third_party/WebKit/Source/modules/fetch/RequestTest.cpp
@@ -69,10 +69,12 @@ TEST_F(ServiceWorkerRequestTest, FromAndToWebRequest)
const String referrer = "http://www.referrer.com/";
const WebReferrerPolicy referrerPolicy = WebReferrerPolicyAlways;
const WebURLRequest::RequestContext context = WebURLRequest::RequestContextAudio;
+ const WebURLRequest::FetchRequestMode mode = WebURLRequest::FetchRequestModeNavigate;
webRequest.setURL(url);
webRequest.setMethod(method);
webRequest.setRequestContext(context);
+ webRequest.setMode(mode);
for (int i = 0; headers[i].key; ++i)
webRequest.setHeader(WebString::fromUTF8(headers[i].key), WebString::fromUTF8(headers[i].value));
webRequest.setReferrer(referrer, referrerPolicy);
@@ -83,6 +85,7 @@ TEST_F(ServiceWorkerRequestTest, FromAndToWebRequest)
EXPECT_EQ(method, request->method());
EXPECT_EQ("audio", request->context());
EXPECT_EQ(referrer, request->referrer());
+ EXPECT_EQ("navigate", request->mode());
Headers* requestHeaders = request->headers();
@@ -104,6 +107,7 @@ TEST_F(ServiceWorkerRequestTest, FromAndToWebRequest)
EXPECT_EQ(referrer, KURL(secondWebRequest.referrerUrl()));
EXPECT_EQ(WebReferrerPolicyDefault, secondWebRequest.referrerPolicy());
EXPECT_EQ(webRequest.headers(), secondWebRequest.headers());
+ EXPECT_EQ(WebURLRequest::FetchRequestModeNoCORS, secondWebRequest.mode());
}
TEST_F(ServiceWorkerRequestTest, ToWebRequestStripsURLFragment)
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/RequestInit.cpp ('k') | third_party/WebKit/public/platform/WebURLRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698