dom/xbl/test/file_bug950909.xml

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 <bindings id="chromeTestBindings" xmlns="http://www.mozilla.org/xbl">
     3   <binding id="testBinding">
     4     <implementation implements="nsIObserver">
     5       <constructor>
     6       <![CDATA[
     7         // This binding gets applied to a content object, and thus is actually
     8         // running in a content XBL scope.
     9         var win = XPCNativeWrapper.unwrap(window);
    10         var SpecialPowers = win.SpecialPowers;
    11         var ok = SpecialPowers.unwrap(SpecialPowers.wrap(window).parent.ok);
    12         ok(win != window, "Should be running in an XBL scope with Xrays");
    14         // Generate an XPCWrappedJS for the reflector. We need to do this
    15         // explicitly with a testing helper, because we're converging on
    16         // removing XPConnect from the web, which means that it won't be
    17         // possible to generate an XPCWrappedJS from content (or XBL) code.
    18         var scope = {};
    19         var holder = SpecialPowers.Cu.generateXPCWrappedJS(this, scope);
    21         // Now, QI |this|, which will generate an aggregated native.
    22         this.QueryInterface(Components.interfaces.nsIObserver);
    24         ok(true, "Didn't assert or crash");
    26         SpecialPowers.wrap(window).parent.SimpleTest.finish();
    27       ]]>
    28       </constructor>
    29       <method name="observe">
    30         <parameter name="aSubject"/>
    31         <parameter name="aTopic"/>
    32         <parameter name="aData"/>
    33         <body><![CDATA[]]></body>
    34       </method>
    35     </implementation>
    36   </binding>
    37 </bindings>

mercurial