Index: chrome/test/data/prerender/prerender_loader_removing_links.html |
diff --git a/chrome/test/data/prerender/prerender_loader_removing_links.html b/chrome/test/data/prerender/prerender_loader_removing_links.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c9581dc1dd89986d794d373e91826cc78f05cfb |
--- /dev/null |
+++ b/chrome/test/data/prerender/prerender_loader_removing_links.html |
@@ -0,0 +1,39 @@ |
+<html> |
+<head> |
+<title>Preloader</title> |
+ |
+<script> |
+function ExtractGetParameterBadlyAndInsecurely(param, default_value) { |
+ var re = RegExp("[&?]" + param + "=([^&?#]*)"); |
+ var result = re.exec(document.location); |
+ if (result) |
+ return result[1]; |
+ return default_value; |
+} |
+ |
+var links_to_insert = ExtractGetParameterBadlyAndInsecurely( |
+ 'links_to_insert', 1); |
+var links_to_remove = ExtractGetParameterBadlyAndInsecurely( |
+ 'links_to_remove', 1); |
+ |
+function RemoveLinkElementAndNavigate() { |
+ for (var i = 1; i <= links_to_remove; ++i) { |
+ var link = document.getElementById("prerender_element_" + i); |
+ link.parentElement.removeChild(link); |
+ } |
+ document.location = "REPLACE_WITH_DESTINATION_URL"; |
+} |
+</script> |
+ |
+</head> |
+<body> |
+<script> |
+ for (var i = 1; i <= links_to_insert; ++i) { |
+ document.write('<link id="prerender_element_' + |
+ i + |
+ '" rel="prerender" href="REPLACE_WITH_PRERENDER_URL"/>'); |
+ } |
+</script> |
+<a href="REPLACE_WITH_DESTINATION_URL">Link To Click</a> |
+</body> |
+</html> |