imported patch fix-tests
authorDan Witte <dwitte@mozilla.com>
Fri, 13 Aug 2010 21:18:05 -0700
changeset 50576 d5d9ca9a444597a37b24a4a927f7e9f37a381e0d
parent 50575 bcd40dd716400c3f44ec4afdfff30eb667759da5
child 50577 b6c7ed5a29223eb18b84ed4c76a88800a266568f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
imported patch fix-tests
netwerk/test/unit/test_resumable_channel.js
--- a/netwerk/test/unit/test_resumable_channel.js
+++ b/netwerk/test/unit/test_resumable_channel.js
@@ -209,33 +209,34 @@ function run_test() {
   function success(request, data, ctx) {
     dump("*** success()\n");
     do_check_true(request.nsIHttpChannel.requestSucceeded);
     do_check_eq(data, rangeBody);
 
 
     // Authentication (no password; working resume)
     // (should not give us any data)
-    // XXX skip all authentication tests for now, as they're busted on e10s (bug 587146)
+    // XXX skip authentication tests on e10s (bug 587146)
     try { // nsIXULRuntime is not available in some configurations.
       let processType = Components.classes["@mozilla.org/xre/runtime;1"].
                         getService(Components.interfaces.nsIXULRuntime).processType;
-      if (processType == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
+      if (processType != Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
+        // 404 page (same content length as real content)
         var chan = make_channel("http://localhost:4444/range");
         chan.nsIResumableChannel.resumeAt(1, entityID);
-        chan.nsIHttpChannel.setRequestHeader("X-Need-Auth", "true", false);
-        chan.asyncOpen(new ChannelListener(test_auth_nopw, null, CL_EXPECT_FAILURE), null);
+        chan.nsIHttpChannel.setRequestHeader("X-Want-404", "true", false);
+        chan.asyncOpen(new ChannelListener(test_404, null, CL_EXPECT_FAILURE), null);
+        return;
       }
     } catch (e) { }
 
-    // 404 page (same content length as real content)
     var chan = make_channel("http://localhost:4444/range");
     chan.nsIResumableChannel.resumeAt(1, entityID);
-    chan.nsIHttpChannel.setRequestHeader("X-Want-404", "true", false);
-    chan.asyncOpen(new ChannelListener(test_404, null, CL_EXPECT_FAILURE), null);
+    chan.nsIHttpChannel.setRequestHeader("X-Need-Auth", "true", false);
+    chan.asyncOpen(new ChannelListener(test_auth_nopw, null, CL_EXPECT_FAILURE), null);
   }
 
   function test_auth_nopw(request, data, ctx) {
     dump("*** test_auth_nopw()\n");
     do_check_false(request.nsIHttpChannel.requestSucceeded);
     do_check_eq(request.status, NS_ERROR_ENTITY_CHANGED);
 
     // Authentication + not working resume
@@ -280,32 +281,21 @@ function run_test() {
     chan.asyncOpen(new ChannelListener(test_416, null, CL_EXPECT_FAILURE), null);
   }
 
   function test_416(request, data, ctx) {
     dump("*** test_416()\n");
     do_check_eq(request.status, NS_ERROR_ENTITY_CHANGED);
     do_check_eq(request.nsIHttpChannel.responseStatus, 416);
 
-    // XXX skip redirect/resume tests, as they're busted on e10s (bug 587165)
-    try { // nsIXULRuntime is not available in some configurations.
-      let processType = Components.classes["@mozilla.org/xre/runtime;1"].
-                        getService(Components.interfaces.nsIXULRuntime).processType;
-      if (processType == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
-        // Redirect + successful resume
-        var chan = make_channel("http://localhost:4444/redir");
-        chan.nsIHttpChannel.setRequestHeader("X-Redir-To", "http://localhost:4444/range", false);
-        chan.nsIResumableChannel.resumeAt(1, entityID);
-        chan.asyncOpen(new ChannelListener(test_redir_resume, null), null);
-      } else {
-        httpserver.stop(do_test_finished);
-      }
-    } catch (e) {
-      httpserver.stop(do_test_finished);
-    }
+    // Redirect + successful resume
+    var chan = make_channel("http://localhost:4444/redir");
+    chan.nsIHttpChannel.setRequestHeader("X-Redir-To", "http://localhost:4444/range", false);
+    chan.nsIResumableChannel.resumeAt(1, entityID);
+    chan.asyncOpen(new ChannelListener(test_redir_resume, null), null);
   }
 
   function test_redir_resume(request, data, ctx) {
     dump("*** test_redir_resume()\n");
     do_check_true(request.nsIHttpChannel.requestSucceeded);
     do_check_eq(data, rangeBody.substring(1));
     do_check_eq(request.nsIHttpChannel.responseStatus, 206);