mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 775287 - Track request count in storage server; r=rnewman
This commit is contained in:
parent
2d338f4adf
commit
c727c2d588
@ -876,11 +876,12 @@ let StorageServerCallback = {
|
||||
* StorageServerCallback) as input.
|
||||
*/
|
||||
function StorageServer(callback) {
|
||||
this.callback = callback || {__proto__: StorageServerCallback};
|
||||
this.server = new HttpServer();
|
||||
this.started = false;
|
||||
this.users = {};
|
||||
this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
this.callback = callback || {__proto__: StorageServerCallback};
|
||||
this.server = new HttpServer();
|
||||
this.started = false;
|
||||
this.users = {};
|
||||
this.requestCount = 0;
|
||||
this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
|
||||
// Install our own default handler. This allows us to mess around with the
|
||||
// whole URL space.
|
||||
@ -1266,6 +1267,7 @@ StorageServer.prototype = {
|
||||
* TODO: need to use the correct Storage API response codes and errors here.
|
||||
*/
|
||||
handleDefault: function handleDefault(handler, req, resp) {
|
||||
this.requestCount++;
|
||||
let timestamp = new_timestamp();
|
||||
try {
|
||||
this._handleDefault(handler, req, resp, timestamp);
|
||||
|
@ -187,10 +187,12 @@ add_test(function test_basic_http() {
|
||||
server.startSynchronous(PORT);
|
||||
|
||||
_("Started on " + server.port);
|
||||
do_check_eq(server.requestCount, 0);
|
||||
let req = localRequest("/2.0/storage/crypto/keys");
|
||||
_("req is " + req);
|
||||
req.get(function (err) {
|
||||
do_check_eq(null, err);
|
||||
do_check_eq(server.requestCount, 1);
|
||||
server.stop(run_next_test);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user