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

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

Issue 2440803002: Filter out data urls in the preload scanner (Closed)
Patch Set: nits and test 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..677677633cdb5d659994c18bb3b34f1efa9c1f3a 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
@@ -725,4 +725,19 @@ TEST_F(HTMLPreloadScannerTest, testLinkRelPreload) {
test(testCase);
}
+TEST_F(HTMLPreloadScannerTest, testNoDataUrls) {
+ TestCase testCases[] = {
+ {"http://example.test",
+ "<link rel=preload href='data:text/html,<p>data</data>'>", nullptr,
+ "http://example.test/", Resource::Raw, 0},
+ {"http://example.test", "<img src='data:text/html,<p>data</data>'>",
+ nullptr, "http://example.test/", Resource::Image, 0},
+ {"data:text/html,<a>anchor</a>", "<img src='#anchor'>", nullptr,
+ "http://example.test/", Resource::Image, 0},
+ };
+
+ for (const auto& testCase : testCases)
+ test(testCase);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698