Index: LayoutTests/http/tests/security/anchor-download-block-crossorigin.html |
diff --git a/LayoutTests/http/tests/security/anchor-download-block-crossorigin.html b/LayoutTests/http/tests/security/anchor-download-block-crossorigin.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cf8772c2167212e783f6946de885a530a16617b8 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/anchor-download-block-crossorigin.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script type='text/javascript'> |
+if (window.testRunner) { |
+ // The test will end when loadURLExternally() is invoked. |
+ testRunner.waitUntilExternalURLLoad(); |
+} |
+</script> |
+</head> |
+<body> |
+<p> |
+Tests that a suggested filename on a download attribute is ignored if |
+<a id="dl" href="http://localhost:8080/security/resources/attachment.php" download="foo.pdf">the link</a> is cross origin. |
+<p> |
+The suggested filename at the top should be empty. |
+<script> |
+function click(elmt) |
+{ |
+ if (!window.eventSender) { |
+ return; |
+ } |
+ eventSender.mouseMoveTo(elmt.offsetLeft + 5, elmt.offsetTop + 5); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+} |
+ |
+function runTest() |
+{ |
+ var link = document.getElementById("dl"); |
+ click(link); |
+} |
+runTest(); |
+</script> |
+</body> |
+</html> |