content/base/test/chrome/test_bug780529.xul

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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=780529
     6 -->
     7 <window title="Mozilla Bug 780529"
     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=780529"
    14      target="_blank">Mozilla Bug 780529</a>
    15   </body>
    17   <!-- test code goes here -->
    18   <script type="application/javascript">
    19   <![CDATA[
    20   /** Test for Bug 780529 **/
    21 var req = new XMLHttpRequest();
    22 req.open("GET", "", true);
    23 // Have to call send() to get the XHR hooked up as the notification callbacks
    24 req.send();
    25 var callbacks = req.channel.notificationCallbacks;
    26 var sink = callbacks.getInterface(Components.interfaces.nsIChannelEventSink);
    27 ok(sink instanceof Components.interfaces.nsIChannelEventSink,
    28    "Should be a channel event sink")
    29 ok("asyncOnChannelRedirect" in sink,
    30    "Should have the right methods for an event sink");
    32 is(callbacks.getInterface(Components.interfaces.nsIXMLHttpRequest), req,
    33    "Should have the right object");
    34 sinkReq = sink.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
    35 isnot(sinkReq, callbacks, "Sink should not be the XHR object");
    36 is(sinkReq.getInterface(Components.interfaces.nsIXMLHttpRequest), req,
    37    "Should have the XHR object now");
    38   ]]>
    39   </script>
    40 </window>

mercurial