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:
Myk Melez 2009-01-28 17:51:23 -08:00
parent 72b7f9bf27
commit fca1820177
2 changed files with 7 additions and 6 deletions

View File

@ -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();

View File

@ -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