Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / htmlimports / redirect-cross-origin-cross.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 <link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" />
7
8 <link id="cors-xs" rel="import" href="http://localhost:8000/security/resources/cors-redir.php?url=http://localhost:8000/htmlimports/resources/hello.html">
9 </head>
10
11 <script>
12 function assert_loaded(id)
13 {
14     var target = document.getElementById(id);
15     assert_true(target.import instanceof Document)
16     assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello"));
17 }
18
19 function assert_not_loaded(id)
20 {
21     var target = document.getElementById(id);
22     assert_equals(target.import, null);
23 }
24
25 test(function() { assert_not_loaded("cors-xs"); }, "Blocking access to a cross origin import including CORS domain redirect");
26 </script>
27 </body>
28 </html>