dom/bindings/test/test_bug707564-chrome.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/bindings/test/test_bug707564-chrome.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=707564
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 707564</title>
    1.12 +  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=707564">Mozilla Bug 707564</a>
    1.17 +<p id="display"></p>
    1.18 +<div id="content" style="display: none">
    1.19 +<iframe id="t1" src="http://example.org/tests/dom/bindings/test/file_bug707564.html"></iframe>
    1.20 +<iframe id="t2" src="http://example.org/tests/dom/bindings/test/file_bug707564.html"></iframe>
    1.21 +</div>
    1.22 +<pre id="test">
    1.23 +<script type="application/javascript">
    1.24 +
    1.25 +/** Test for Bug 775543 **/
    1.26 +function test()
    1.27 +{
    1.28 +  var nav = document.getElementById("t1").contentWindow.navigator;
    1.29 +  ise(nav.foopy, undefined, "We should have an Xray now");
    1.30 +  is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object");
    1.31 +  var props = Object.getOwnPropertyNames(nav);
    1.32 +  isnot(props.indexOf("mozApps"), -1,
    1.33 +        "Should enumerate a mozApps property on navigator xray");
    1.34 +
    1.35 +  var nav = document.getElementById("t2").contentWindow.navigator;
    1.36 +  ise(nav.foopy, undefined, "We should have an Xray now again");
    1.37 +  is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again");
    1.38 +  var found = false;
    1.39 +  for (var name in nav) {
    1.40 +    if (name == "mozApps") {
    1.41 +      found = true;
    1.42 +    }
    1.43 +  }
    1.44 +  ok(found, "Should enumerate a mozApps property on navigator xray via for...in");
    1.45 +
    1.46 +  SimpleTest.finish();
    1.47 +}
    1.48 +
    1.49 +addLoadEvent(test);
    1.50 +
    1.51 +SimpleTest.waitForExplicitFinish();
    1.52 +</script>
    1.53 +</pre>
    1.54 +</body>
    1.55 +</html>

mercurial