[JSC] Int52Rep(DoubleRepAnyIntUse) should not call operation function
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / the-iframe-element / iframe_sandbox_anchor_download_allow_downloads_without_user_activation.sub.tentative.html
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>&lt;a download&gt; triggered download in sandbox is allowed by allow-downloads-without-user-activation.</title>
4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-iframe-sandbox">
5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
6 <script src="/resources/testharness.js"></script>
7 <script src='/resources/testharnessreport.js'></script>
8 <script src="support/iframe_sandbox_download_helper.js"></script>
9 <body>
10 <script>
11 "use strict";
12
13 async_test(t => {
14     const token = "{{$id:uuid()}}";
15     var iframe = document.createElement("iframe");
16     iframe.srcdoc = "<a>Download</a>";
17     iframe.sandbox = "allow-same-origin allow-downloads-without-user-activation";
18     iframe.onload = t.step_func(function () {
19         iframe.contentWindow.addEventListener(
20             "unload", t.unreached_func("Unexpected navigation."));
21         var anchor = iframe.contentDocument.getElementsByTagName('a')[0];
22         anchor.href = "support/download_stash.py?token=" + token;
23         anchor.download = null;
24         anchor.click();
25         AssertDownloadSuccess(t, token, DownloadVerifyDelay());
26     });
27
28     document.body.appendChild(iframe);
29 }, "<a download> triggered download in sandbox is allowed by allow-downloads-without-user-activation.");
30 </script>
31 </body>