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

Unified Diff: LayoutTests/http/tests/security/anchor-download-allow-sameorigin.html

Issue 197033005: Ignore suggested download filename for cross origin links. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revive Created 6 years, 8 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: LayoutTests/http/tests/security/anchor-download-allow-sameorigin.html
diff --git a/LayoutTests/http/tests/security/anchor-download-allow-sameorigin.html b/LayoutTests/http/tests/security/anchor-download-allow-sameorigin.html
new file mode 100644
index 0000000000000000000000000000000000000000..733e75acfabd192aa28cca12ed0fa40ebf085e12
--- /dev/null
+++ b/LayoutTests/http/tests/security/anchor-download-allow-sameorigin.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 allowed if
+<a id="dl" href="/security/resources/attachment.php" download="foo.pdf">the link</a> is in the same origin.
+<p>
+The suggested filename at the top should be foo.pdf.
+<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>

Powered by Google App Engine
This is Rietveld 408576698