Bug 508128. Make sure to QI to the right interface so that if the JS wrapper gets GCed we still have a getRequestHeader method.
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 04 Nov 2009 07:39:41 +1300
changeset 34498 4aa00e390ced254147d59d00bb4172c5a52f777e
parent 34497 89bce43a99d1dbf7e28a57e36b4d63c0be9dc316
child 34499 971b1e294cd213818ae175cdd85f145bc4abf8f5
push id10085
push userrocallahan@mozilla.com
push dateTue, 03 Nov 2009 18:42:12 +0000
treeherdermozilla-central@8857ad3785a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs508128
milestone1.9.3a1pre
Bug 508128. Make sure to QI to the right interface so that if the JS wrapper gets GCed we still have a getRequestHeader method.
netwerk/test/unit/test_cookie_header.js
--- a/netwerk/test/unit/test_cookie_header.js
+++ b/netwerk/test/unit/test_cookie_header.js
@@ -2,28 +2,28 @@
 
 do_load_httpd_js();
 
 function check_request_header(chan, name, value) {
   var chanValue;
   try {
     chanValue = chan.getRequestHeader(name);
   } catch (e) {
-    do_throw("Expected to find header '" + name + "' but didn't find it");
+    do_throw("Expected to find header '" + name + "' but didn't find it, got exception: " + e);
   }
   dump("Value for header '" + name + "' is '" + chanValue + "'\n");
   do_check_eq(chanValue, value);
 }
 
 var cookieVal = "C1=V1";
 
 var listener = {
   onStartRequest: function test_onStartR(request, ctx) {
     try {
-      var chan = request.QueryInterface(Components.interfaces.nsIChannel);
+      var chan = request.QueryInterface(Components.interfaces.nsIHttpChannel);
       check_request_header(chan, "Cookie", cookieVal);
     } catch (e) {
       do_throw("Unexpected exception: " + e);
     }
 
     throw Components.results.NS_ERROR_ABORT;
   },