f9912e5b0aaac65108d447b0a2dff923f7bc82b6
[WebKit-https.git] / LayoutTests / fast / dom / Window / Location / ancestor-origins.html
1 <head>
2     <script src="../../../../resources/js-test-pre.js"></script>
3     <script src="resources/location-tests-functions.js"></script>
4 </head>
5
6 <script>
7
8 self.jsTestIsAsync = true;
9
10 description("Test the Location object's ancestorOrigins property.")
11
12 shouldBeType("window.location.ancestorOrigins", "Array");
13 shouldBe("window.location.ancestorOrigins.length", "0");
14 shouldBeTrue("Object.isFrozen(window.location.ancestorOrigins)");
15 shouldBeTrue("window.location.ancestorOrigins === window.location.ancestorOrigins");
16
17 var subframeOrigins;
18
19 window.onmessage = function(event)
20 {
21     subframeOrigins = event.data;
22
23     shouldBeType("subframeOrigins", "Array");
24     shouldBe("subframeOrigins.length", "1");
25     shouldBe("subframeOrigins[0]", "'file://'");
26
27     finishJSTest();
28 }
29
30 </script>
31 <iframe srcdoc="
32   <script>
33     top.postMessage(location.ancestorOrigins, '*')
34   </script>
35 "></iframe>
36 <script src="../../../../resources/js-test-post.js"></script>