Commit 0305578b 0305578ba651f44101b7a57b74587d388e02b4ec by Nicolas Perriault

fixed resources array is now reset adequately

reference discussion: https://groups.google.com/forum/?hl=fr?fromgroups#!topic/casperjs/TCkNzrj1IoA
1 parent 5258976d
......@@ -7,6 +7,7 @@ XXXX-XX-XX, v0.6.9
- fixed [#114](https://github.com/n1k0/casperjs/issues/114) - ensured client-side utils are injected before any `evaluate()` call
- fixed [#117](https://github.com/n1k0/casperjs/issues/117) - `fill()` coulnd't `submit()` a form with a submit input named *submit*
- merged [#122](https://github.com/n1k0/casperjs/pull/122) - allow downloads to be triggered by more than just `GET` requests
- fixed loaded resources array is now reset adequately [reference discussion](https://groups.google.com/forum/?hl=fr?fromgroups#!topic/casperjs/TCkNzrj1IoA)
2012-05-20, v0.6.8
------------------
......
......@@ -746,6 +746,7 @@ Casper.prototype.open = function open(location, settings) {
operation: settings.method,
data: settings.data
}, this.page.settings);
this.resources = [];
return this;
};
......@@ -775,17 +776,18 @@ Casper.prototype.resourceExists = function resourceExists(test) {
var testFn;
switch (utils.betterTypeOf(test)) {
case "string":
testFn = function _test(res) {
testFn = function _testResourceExists_String(res) {
return res.url.search(test) !== -1;
};
break;
case "regexp":
testFn = function _test(res) {
testFn = function _testResourceExists_Regexp(res) {
return test.test(res.url);
};
break;
case "function":
testFn = test;
testFn.name = "_testResourceExists_Function";
break;
default:
throw new CasperError("Invalid type");
......@@ -1299,7 +1301,6 @@ function createPage(casper) {
};
page.onLoadStarted = function onLoadStarted() {
casper.loadInProgress = true;
casper.resources = [];
casper.emit('load.started');
};
page.onLoadFinished = function onLoadFinished(status) {
......