Introduce Storage Access API (document parts) as an experimental feature
[WebKit-https.git] / LayoutTests / http / tests / storageAccess / request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script src="/js-test-resources/js-test.js"></script>
5     <script src="/js-test-resources/ui-helper.js"></script>
6     <script>
7         description("Tests that cross-origin iframe storage access is denied if the iframe is sandboxed and has the unique origin because it lacks the allow-same-origin token.");
8         jsTestIsAsync = true;
9
10         function activateElement(elementId) {
11             var element = document.getElementById(elementId);
12             var centerX = element.offsetLeft + element.offsetWidth / 2;
13             var centerY = element.offsetTop + element.offsetHeight / 2;
14             UIHelper.activateAt(centerX, centerY).then(
15                 function () {
16                     if (window.eventSender)
17                         eventSender.keyDown("escape");
18                     finishJSTest();
19                 },
20                 function () {
21                     testFailed("Promise rejected.");
22                     finishJSTest();
23                 }
24             );
25         }
26
27         function runTest() {
28             activateElement("theIframe");
29         }
30     </script>
31 </head>
32 <body>
33     <iframe sandbox="allow-storage-access-by-user-activation allow-scripts allow-modals" onload="runTest()" id="theIframe" src="http://localhost:8000/storageAccess/resources/request-storage-access-iframe.html#userShouldGrantAccess,userShouldNotBeConsulted,policyShouldDenyAccess,isNotSameOriginIframe"></iframe>
34 </body>
35 </html>