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-window-open.html
1 <html>
2 <head>
3     <script src="../resources/cross-frame-access.js"></script>
4     <script>
5         var openedWindow;
6
7         window.onload = function()
8         {
9             if (window.testRunner) {
10                 testRunner.dumpAsText();
11                 testRunner.waitUntilDone();
12                 testRunner.setCanOpenWindows();
13             }
14
15             window.addEventListener('message', function ()
16             {
17                 runTest();
18                 closeWindowAndNotifyDone(openedWindow);
19             });
20             openedWindow = window.open("http://localhost:8000/security/dataURL/resources/foreign-domain-data-url-accessee-opened-frame.html");
21         }
22
23         runTest = function()
24         {
25             try {
26                 openedWindow[0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a data: URL embed in a frame window.open'ed on foreign domain allowed.";
27                 log("FAIL: Cross frame access to a data: URL embed in a frame window.open'ed on foreign domain allowed.");
28                 return;
29             } catch (e) {
30             }
31             log("PASS: Cross frame access to a data: URL embed in a frame window.open'ed on foreign domain denied!");
32         }
33     </script>
34 </head>
35 <body>
36     <pre id="console"></pre>
37 </body>
38 </html>