mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 810053 - Add explicit test for obsolete document deletion; r=rnewman
This commit is contained in:
parent
c7d86737ae
commit
6ec7e06edf
@ -273,6 +273,7 @@ BagheeraServer.prototype = {
|
||||
|
||||
if (request.hasHeader("X-Obsolete-Document")) {
|
||||
let obsolete = request.getHeader("X-Obsolete-Document");
|
||||
this._log.info("Deleting from X-Obsolete-Document header: " + obsolete);
|
||||
delete this.namespaces[namespace][obsolete];
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,22 @@ add_test(function test_post_json_bad_data() {
|
||||
});
|
||||
});
|
||||
|
||||
add_test(function test_post_json_delete_obsolete() {
|
||||
let [client, server] = getClientAndServer();
|
||||
server.createNamespace("foo");
|
||||
server.setDocument("foo", "obsolete", "Old payload");
|
||||
|
||||
let promise = client.uploadJSON("foo", "new", {foo: "bar"}, "obsolete");
|
||||
promise.then(function onSuccess(result) {
|
||||
do_check_true(result.transportSuccess);
|
||||
do_check_true(result.serverSuccess);
|
||||
do_check_true(server.hasDocument("foo", "new"));
|
||||
do_check_false(server.hasDocument("foo", "obsolete"));
|
||||
|
||||
server.stop(run_next_test);
|
||||
});
|
||||
});
|
||||
|
||||
add_test(function test_delete_document() {
|
||||
let [client, server] = getClientAndServer();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user