Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / security / dataURL / xss-DENIED-to-data-url-in-foreign-domain-subframe.html
1 <html>
2 <head>
3     <script src="../resources/cross-frame-access.js"></script>
4     <script>
5         window.onload = function()
6         {
7             if (window.testRunner) {
8                 testRunner.dumpAsText();
9                 testRunner.dumpChildFramesAsText();
10                 testRunner.waitUntilDone();
11             }
12
13             window.addEventListener('message', function ()
14             {
15                 runTest();
16                 testRunner.notifyDone();
17             });
18         }
19
20         runTest = function()
21         {
22             try {
23                 window[0][0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a data: URL embed in a frame on a foreign domain allowed.";
24                 log("FAIL: Cross frame access to a data: URL embed in a frame on a foreign domain allowed.");
25                 return;
26             } catch (e) {
27             }
28             log("PASS: Cross frame access to a data: URL embed in a frame on a foreign domain denied!");
29         }
30     </script>
31 </head>
32 <body>
33     <p>The scenario for this test is that you have an iframe with content from a foreign domain.  In that foreign content
34         is an iframe which loads a data: URL.  This tests that this main document does not have access to that 
35         data: URL loaded iframe.</p>
36     <iframe src="http://localhost:8000/security/dataURL/resources/foreign-domain-data-url-accessee-iframe.html" style="width: 400px; height:200px;"></iframe>
37     <pre id="console"></pre>
38 </body>
39 </html>