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

Unified Diff: chrome/test/data/safe_browsing/prefetch_malware.html

Issue 6334131: Turn off safebrowsing for PREFETCH requests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up unit test, per pending fix to 75507 Created 9 years, 9 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: chrome/test/data/safe_browsing/prefetch_malware.html
diff --git a/chrome/test/data/safe_browsing/prefetch_malware.html b/chrome/test/data/safe_browsing/prefetch_malware.html
new file mode 100644
index 0000000000000000000000000000000000000000..f55336defe4f8bc47dc6cedb8525548966a1aa13
--- /dev/null
+++ b/chrome/test/data/safe_browsing/prefetch_malware.html
@@ -0,0 +1,38 @@
+<html>
+<head>
+<script>
+function log(message)
+{
+ var item = document.createElement("li");
+ item.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(item);
+}
+
+function return_malware_prefetch() {
+ var pathArray = window.location.pathname.split('/');
+ var newPathname = "";
+ for ( i=0; i < pathArray.length - 1; i++ ) {
+ newPathname += pathArray[i];
+ newPathname += "/";
+ }
+ newPathname += "malware.html";
+ var href = window.location.protocol + "//" + window.location.host + newPathname;
+ var link = document.createElement("link");
+ link.rel = "prefetch";
+ link.href = href;
+ log(link.outerHTML);
+ return link; }
+
+function add_prefetch(element) {
+ var head = document.getElementsByTagName("head")[0];
+ head.appendChild(element);
+}
+</script>
+</head>
+<body onload="add_prefetch(return_malware_prefetch());">
+This page is not malware, <a href="malware.html">but this page is</a>. If
+prefetches don't trigger safe browsing interstitials, then this page
+should work in a dandy manner.
+<p><ol id="console"></ol></p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698