Bug 1257533 - Address others review comments,r=MattN draft
authorMathieu Leplatre <mathieu@mozilla.com>
Thu, 14 Apr 2016 16:41:35 +0200
changeset 350958 8ea7d64aec0b2234b415b70c33a6e2988b234107
parent 350953 726d33f7368e9500d4028f783b33e351ce307795
child 351048 041803c776c9990dbb420dc745401b53d36a2b39
push id15455
push usermleplatre@mozilla.com
push dateThu, 14 Apr 2016 14:42:30 +0000
reviewersMattN
bugs1257533
milestone48.0a1
Bug 1257533 - Address others review comments,r=MattN MozReview-Commit-ID: Emx93xHy3qP
services/common/tests/unit/test_kinto_updater.js
--- a/services/common/tests/unit/test_kinto_updater.js
+++ b/services/common/tests/unit/test_kinto_updater.js
@@ -56,17 +56,17 @@ add_task(function* test_check_maybeSync(
   let startTime = Date.now();
 
   let updater = Cu.import("resource://services-common/kinto-updater.js");
 
   let syncPromise = new Promise(function(resolve, reject) {
     // add a test kinto client that will respond to lastModified information
     // for a collection called 'test-collection'
     updater.addTestKintoClient("test-collection", {
-      maybeSync: function(lastModified, serverTime) {
+      maybeSync: (lastModified, serverTime) => {
         do_check_eq(lastModified, 1000);
         do_check_eq(serverTime, 2000);
         resolve();
       }
     });
     updater.checkVersions();
   });
 
@@ -155,17 +155,15 @@ function getSampleResponse(req, port) {
         "last_modified": 1000,
         "bucket": "blocklists",
         "id": "254cbb9e-6888-4d9f-8e60-58b74faa8778",
         "collection": "test-collection"
       }]})
     }
   };
 
-  // if (req.headers.get("If-None-Match") == '"1100"')
-  // "TypeError: req.headers.get is not a function"
-  // https://developer.mozilla.org/en-US/docs/Web/API/Request/headers
-  if (req._headers._headers["if-none-match"] && req._headers._headers["if-none-match"][0] == "\"1100\"")
+  if (req.getHeader("if-none-match") == "\"1100\"") {
     return {sampleHeaders: [], status: {status: 304, statusText: "Not Modified"}, responseBody: ""};
+  }
 
   return responses[`${req.method}:${req.path}?${req.queryString}`] ||
          responses[req.method];
 }