test_bug780529.xhtml (1348B)
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 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> 10 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> 16 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(Ci.nsIChannelEventSink); 27 ok(sink instanceof Ci.nsIChannelEventSink, 28 "Should be a channel event sink") 29 ok("asyncOnChannelRedirect" in sink, 30 "Should have the right methods for an event sink"); 31 32 let sinkReq = sink.QueryInterface(Ci.nsIInterfaceRequestor); 33 isnot(sinkReq, callbacks, "Sink should not be the XHR object"); 34 ]]> 35 </script> 36 </window>