dom/tests/mochitest/chrome/test_cyclecollector.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
     3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
     4 <!--
     5 https://bugzilla.mozilla.org/show_bug.cgi?id=
     6 -->
     7 <window title="Mozilla Bug "
     8         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    11   <!-- test results are displayed in the html:body -->
    12   <body xmlns="http://www.w3.org/1999/xhtml">
    13   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id="
    14      target="_blank">Mozilla Bug </a>
    15   </body>
    17   <!-- test code goes here -->
    18   <script type="application/javascript">
    19   <![CDATA[
    20   /** Test for Bug  **/
    21   var obs = Components.classes["@mozilla.org/observer-service;1"]
    22                       .getService(Components.interfaces.nsIObserverService);
    23   var didCall = false;
    24   var observer = {
    25     QueryInterface: function QueryInterface(aIID) {
    26       if (aIID.equals(Components.interfaces.nsIObserver) ||
    27           aIID.equals(Components.interfaces.nsISupports))
    28         return this;
    29       throw Components.results.NS_NOINTERFACE;
    30     },
    31     observe: function(subject, topic, data) {
    32       obs.removeObserver(observer, "cycle-collector-begin");
    33       observer = null;
    34       didCall = true;
    35     }
    36   };
    38   obs.addObserver(observer, "cycle-collector-begin", false);
    39   window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    40         .getInterface(Components.interfaces.nsIDOMWindowUtils).cycleCollect();
    42   ok(didCall, "Observer should have been called!");
    43   ]]>
    44   </script>
    45 </window>

mercurial