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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 <script type='text/javascript'>
6 if (window.testRunner) {
7 // The test will end when loadURLExternally() is invoked.
8 testRunner.waitUntilExternalURLLoad();
9 }
10 </script>
11 </head>
12 <body>
13 <p>
14 Tests that a suggested filename on a download attribute is allowed if
15 <a id="dl" href="/security/resources/attachment.php" download="foo.pdf">the link </a> is in the same origin.
16 <p>
17 The suggested filename at the top should be foo.pdf.
18 <script>
19 function click(elmt)
20 {
21 if (!window.eventSender) {
22 return;
23 }
24 eventSender.mouseMoveTo(elmt.offsetLeft + 5, elmt.offsetTop + 5);
25 eventSender.mouseDown();
26 eventSender.mouseUp();
27 }
28
29 function runTest()
30 {
31 var link = document.getElementById("dl");
32 click(link);
33 }
34 runTest();
35 </script>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698