dom/tests/mochitest/chrome/DOMWindowCreated_chrome.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/chrome/DOMWindowCreated_chrome.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
     1.7 +<!--
     1.8 +  Test for Persistent Storage in chrome
     1.9 +  -->
    1.10 +<window id="sample-window" width="400" height="400"
    1.11 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    1.12 +  <script type="application/javascript" 
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.14 +  <script type="application/javascript" 
    1.15 +          src="chrome://mochikit/content/chrome-harness.js"></script>
    1.16 +
    1.17 +<script type="application/javascript">
    1.18 +var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
    1.19 +
    1.20 +document.addEventListener("DOMWindowCreated", function(e) {
    1.21 +  var otherWindow = e.target.defaultView.wrappedJSObject;
    1.22 +  SimpleTest.is(e.type, "DOMWindowCreated", "DOMWindowCreated: " + otherWindow);
    1.23 +  otherWindow.doneFunction = function() {
    1.24 +    SimpleTest.ok(true, "doneFunction was called");
    1.25 +    SimpleTest.finish();
    1.26 +    window.close();
    1.27 +  };
    1.28 +}, false);
    1.29 +
    1.30 +var root = getRootDirectory(window.location.href);
    1.31 +var el = document.createElement("iframe");
    1.32 +el.setAttribute('type', 'content');
    1.33 +el.setAttribute('src', root + 'DOMWindowCreated_content.html');
    1.34 +document.documentElement.appendChild(el);
    1.35 +</script>
    1.36 +</window>

mercurial