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 291241 9f3adfd2ca520a8f87ad58602f4241b179c86584
parent 291240 cd8cf8418f05243834490c3b1101a705d6aad61e
child 291242 314e201aa2d7d6464f72fa7b676fe51d36cfd896
push id5231
push useratolfsen@mozilla.com
push dateWed, 09 Sep 2015 14:01:39 +0000
bugs815299
milestone43.0a1
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 + "'");