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