Bug 694657 - Part 1: Sync: test JS server 404 for GET on missing WBO. r=philikon

This commit is contained in:
Richard Newman 2011-10-15 15:29:11 -07:00
Родитель 32be0e71e1
Коммит 31440a22b7
2 изменённых файлов: 23 добавлений и 8 удалений

Просмотреть файл

@ -878,6 +878,10 @@ SyncServer.prototype = {
switch (req.method) {
case "GET":
if (!coll) {
if (wboID) {
respond(404, "Not found", "Not found");
return;
}
// *cries inside*: Bug 687299.
respond(200, "OK", "[]");
return;

Просмотреть файл

@ -203,14 +203,25 @@ add_test(function test_storage_request() {
Utils.nextTick(next);
});
}
server.start(8080, function () {
retrieveWBONotExists(
retrieveWBOExists.bind(this,
getStorageFails.bind(this,
deleteStorage.bind(this, function () {
server.stop(run_next_test);
}))));
});
function getMissingCollectionWBO(next) {
_("Testing that fetching a WBO from an on-existent collection 404s.");
let req = localRequest(storageURL + "/foobar/baz");
req.get(function (err) {
do_check_eq(this.response.status, 404);
Utils.nextTick(next);
});
}
server.start(8080,
Async.chain(
retrieveWBONotExists,
retrieveWBOExists,
getStorageFails,
getMissingCollectionWBO,
deleteStorage,
server.stop.bind(server),
run_next_test
));
});
add_test(function test_x_weave_records() {