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> |