Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / navigator-with-content-detached-no-crash.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body onload="test()">
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description("Check if calling detached navigator's APIs is safe.");
11
12 window.jsTestIsAsync = true;
13
14 function test() {
15   old_nav = window.frames[0].navigator;
16   var p = document.getElementById('subframe');
17   p.parentNode.removeChild(p);
18   check_navigator();
19
20   testPassed('DONE');
21   finishJSTest();
22 }
23
24 function check_navigator() {
25   for (p in old_nav) {
26     if (typeof old_nav[p] === 'function') {
27       try {
28         var v = old_nav[p]();
29       } catch(err) {
30       }
31     }
32   }
33 }
34 </script>
35 <!-- iframe with some contents -->
36 <iframe src="data:text/html,<html></html>" id="subframe"></iframe>
37 </body>
38 </html>