Bug 1257533 - Address others review comments,r=MattN
MozReview-Commit-ID: Emx93xHy3qP
--- 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];
}