Bug 815299 - Part 4: Address jdm's review comments
☠☠ backed out by 2f2051c912c1 ☠ ☠
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 08 Sep 2015 20:38:33 -0400
changeset 294056 9f3adfd2ca520a8f87ad58602f4241b179c86584
parent 294055 cd8cf8418f05243834490c3b1101a705d6aad61e
child 294057 314e201aa2d7d6464f72fa7b676fe51d36cfd896
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs815299
milestone43.0a1
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
Bug 815299 - Part 4: Address jdm's review comments
dom/workers/test/serviceworkers/fetch/fetch_tests.js
dom/workers/test/xhr_headers_server.sjs
--- a/dom/workers/test/serviceworkers/fetch/fetch_tests.js
+++ b/dom/workers/test/serviceworkers/fetch/fetch_tests.js
@@ -329,9 +329,12 @@ fetch(new Request('body-blob', {method: 
 
 expectAsyncResult();
 fetch(new Request('empty-header', {headers:{"emptyheader":""}}))
 .then(function(res) {
   return res.text();
 }).then(function(body) {
   my_ok(body == "emptyheader", "The empty header was observed in the fetch event");
   finish();
+}, function(err) {
+  my_ok(false, "A promise was rejected with " + err);
+  finish();
 });
--- a/dom/workers/test/xhr_headers_server.sjs
+++ b/dom/workers/test/xhr_headers_server.sjs
@@ -6,29 +6,36 @@
 
 function handleRequest(request, response) {
   switch (request.method) {
     case "POST":
       try {
         var optionsHost = request.getHeader("options-host");
       } catch(e) { }
 
+      bool headerFound = false;
       if (optionsHost) {
         setState("postHost", request.host);
         setState("optionsHost", optionsHost);
+        headerFound = true;
       }
 
       try {
         var emptyHeader = "nada" + request.getHeader("empty");
       } catch(e) { }
 
       if (emptyHeader && emptyHeader == "nada") {
         setState("emptyHeader", "nada");
+        headerFound = true;
       }
-      return;
+      if (headerFound) {
+        return;
+      } else {
+        break;
+      }
 
     case "OPTIONS":
       if (getState("optionsHost") == request.host) {
         try {
           var optionsHeader =
             request.getHeader("Access-Control-Request-Headers");
         } catch(e) { }
         setState("optionsHeader", "'" + optionsHeader + "'");