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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp

Issue 2424943002: Add ReferrerPolicy support to preload (Closed)
Patch Set: Test fix Created 4 years, 2 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/html/parser/HTMLPreloadScannerTest.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
index ac5541d73e5571dd2061160fbe29486704c3094a..be25c078929a130fc18f1a000d5635528c1aebd4 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
@@ -615,7 +615,7 @@ TEST_F(HTMLPreloadScannerTest, testReferrerPolicy) {
"bla.gif", "http://example.test/", Resource::Image, 0,
ReferrerPolicyDefault},
{"http://example.test",
- "<img referrerpolicy='origin' referrerpolicy='origin-when-crossorigin' "
+ "<img referrerpolicy='origin' referrerpolicy='origin-when-cross-origin' "
"src='bla.gif'/>",
"bla.gif", "http://example.test/", Resource::Image, 0,
ReferrerPolicyOrigin},
@@ -627,9 +627,24 @@ TEST_F(HTMLPreloadScannerTest, testReferrerPolicy) {
"referrerpolicy='origin' src='bla.gif'/>",
"bla.gif", "http://example.test/", Resource::Image, 0,
ReferrerPolicyOrigin},
+ {"http://example.test",
+ "<link rel=preload as=image referrerpolicy='origin-when-cross-origin' "
+ "href='bla.gif'/>",
+ "bla.gif", "http://example.test/", Resource::Image, 0,
+ ReferrerPolicyOriginWhenCrossOrigin},
+ {"http://example.test",
+ "<link rel=preload as=image referrerpolicy='origin' "
+ "referrerpolicy='origin-when-cross-origin' href='bla.gif'/>",
+ "bla.gif", "http://example.test/", Resource::Image, 0,
+ ReferrerPolicyOrigin},
// The scanner's state is not reset between test cases, so all subsequent
// test cases have a document referrer policy of no-referrer.
{"http://example.test",
+ "<link rel=preload as=image referrerpolicy='not-a-valid-policy' "
+ "href='bla.gif'/>",
+ "bla.gif", "http://example.test/", Resource::Image, 0,
+ ReferrerPolicyNever},
+ {"http://example.test",
"<img referrerpolicy='not-a-valid-policy' src='bla.gif'/>", "bla.gif",
"http://example.test/", Resource::Image, 0, ReferrerPolicyNever},
{"http://example.test", "<img src='bla.gif'/>", "bla.gif",
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp ('k') | third_party/WebKit/Source/core/loader/LinkLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698