Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / htmlimports / redirect-cross-origin-cross-same-2.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="same-cors-same" rel="import" href="/security/resources/redir.php?url=http%3A%2F%2Flocalhost%3A8000%2Fsecurity%2Fresources%2Fcors-redir.php%3Furl%3Dhttp%3A%2F%2F127.0.0.1%3A8000%2Fhtmlimports%2Fresources%2Fhello.html">
9 </head>
10 <body>
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 // The final resource is accessed with a 'null' origin as the 2nd redirect changes origin.
26 test(function() { assert_not_loaded("same-cors-same"); }, "Accessing to a same origin import including intermediate CORS domain redirect");
27 </script>
28 </body>
29 </html>