mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 475855: make the test_auth_manager and test_resource tests work again with recent changes to the Resource object
This commit is contained in:
parent
72b7f9bf27
commit
fca1820177
@ -46,7 +46,7 @@ function async_test() {
|
||||
let res = new Resource("http://localhost:8080/foo");
|
||||
let content = yield res.get(self.cb);
|
||||
do_check_eq(content, "This path exists and is protected");
|
||||
do_check_eq(res.lastRequest.status, 200);
|
||||
do_check_eq(res.lastChannel.responseStatus, 200);
|
||||
|
||||
do_test_finished();
|
||||
server.stop();
|
||||
|
@ -61,7 +61,7 @@ function async_test() {
|
||||
let res = new Resource("http://localhost:8080/open");
|
||||
let content = yield res.get(self.cb);
|
||||
do_check_eq(content, "This path exists");
|
||||
do_check_eq(res.lastRequest.status, 200);
|
||||
do_check_eq(res.lastChannel.responseStatus, 200);
|
||||
|
||||
// 2. A password protected resource (test that it'll fail w/o pass)
|
||||
let res2 = new Resource("http://localhost:8080/protected");
|
||||
@ -73,10 +73,11 @@ function async_test() {
|
||||
// 3. A password protected resource
|
||||
|
||||
let auth = new BasicAuthenticator(new Identity("secret", "guest", "guest"));
|
||||
let res3 = new Resource("http://localhost:8080/protected", auth);
|
||||
let res3 = new Resource("http://localhost:8080/protected");
|
||||
res3.authenticator = auth;
|
||||
content = yield res3.get(self.cb);
|
||||
do_check_eq(content, "This path exists and is protected");
|
||||
do_check_eq(res3.lastRequest.status, 200);
|
||||
do_check_eq(res3.lastChannel.responseStatus, 200);
|
||||
|
||||
// 4. A non-existent resource (test that it'll fail)
|
||||
|
||||
@ -85,8 +86,8 @@ function async_test() {
|
||||
let content = yield res4.get(self.cb);
|
||||
do_check_true(false); // unreachable, get() above must fail
|
||||
} catch (e) {}
|
||||
do_check_eq(res4.lastRequest.responseText, "File not found");
|
||||
do_check_eq(res4.lastRequest.status, 404);
|
||||
do_check_eq(res4.lastChannel.responseStatusText, "Not Found");
|
||||
do_check_eq(res4.lastChannel.responseStatus, 404);
|
||||
|
||||
// FIXME: additional coverage needed:
|
||||
// * PUT requests
|
||||
|
Loading…
Reference in New Issue
Block a user