summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWendall Cada <wendallc@apache.org>2013-04-05 11:38:20 -0700
committerPaul J. Davis <paul.joseph.davis@gmail.com>2014-02-06 23:17:52 -0600
commit35342c4857f47436125b46f962b0401c82d98e7a (patch)
tree85226fba3482c5d54a4c4e1116bcc7f4f6006994
parentbf75f472973189e1cabfea7b417dfcfa9683a265 (diff)
downloadcouchdb-35342c4857f47436125b46f962b0401c82d98e7a.tar.gz
Ensure that waitForSuccess calls have return values.
-rw-r--r--share/www/script/test/changes.js13
-rw-r--r--share/www/script/test/oauth.js1
2 files changed, 13 insertions, 1 deletions
diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index d76c19378..00944f73c 100644
--- a/share/www/script/test/changes.js
+++ b/share/www/script/test/changes.js
@@ -92,6 +92,7 @@ couchTests.changes = function(debug) {
if (change2.seq != 2) {
throw "bad seq, try again";
}
+ return true;
}, "bar-only");
T(change1.seq == 1);
@@ -112,6 +113,7 @@ couchTests.changes = function(debug) {
if (change3.seq != 3) {
throw "bad seq, try again";
}
+ return true;
});
T(change3.seq == 3);
@@ -131,6 +133,7 @@ couchTests.changes = function(debug) {
if (str.charAt(str.length - 1) != "\n" || str.charAt(str.length - 2) != "\n") {
throw("keep waiting");
}
+ return true;
}, "heartbeat");
T(str.charAt(str.length - 1) == "\n");
@@ -152,8 +155,10 @@ couchTests.changes = function(debug) {
source.addEventListener('message', sourceListener , false);
waitForSuccess(function() {
- if (results.length != 3)
+ if (results.length != 3) {
throw "bad seq, try again";
+ }
+ return true;
});
source.removeEventListener('message', sourceListener, false);
@@ -177,6 +182,7 @@ couchTests.changes = function(debug) {
if (lines[5] != '"last_seq":3}') {
throw("still waiting");
}
+ return true;
}, "last_seq");
xhr = CouchDB.newXhr();
@@ -201,6 +207,7 @@ couchTests.changes = function(debug) {
if (lines[3] != '"last_seq":4}') {
throw("still waiting");
}
+ return true;
}, "change_lines");
var change = parse_changes_line(lines[1]);
@@ -233,6 +240,7 @@ couchTests.changes = function(debug) {
if (lines[3] != '"last_seq":5}') {
throw("still waiting");
}
+ return true;
}, "change_lines");
var change = parse_changes_line(lines[1]);
@@ -313,6 +321,7 @@ couchTests.changes = function(debug) {
waitForSuccess(function() {
resp = JSON.parse(xhr.responseText);
+ return true;
}, "longpoll-since");
T(resp.last_seq == 10);
@@ -337,6 +346,7 @@ couchTests.changes = function(debug) {
if (xhr.readyState != 4) {
throw("still waiting");
}
+ return true;
}, "continuous-rusty");
lines = xhr.responseText.split("\n");
var good = false;
@@ -529,6 +539,7 @@ couchTests.changes = function(debug) {
if (xhr.readyState != 4) {
throw("still waiting");
}
+ return true;
}, "andmore-only");
var line = JSON.parse(xhr.responseText.split("\n")[0]);
diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js
index 96293f0a4..8b4e694d6 100644
--- a/share/www/script/test/oauth.js
+++ b/share/www/script/test/oauth.js
@@ -110,6 +110,7 @@ couchTests.oauth = function(debug) {
if (xhr.responseText.indexOf("\"-pbkdf2-") != 0) {
throw("still waiting");
}
+ return true;
}, "wait-for-admin");
CouchDB.newUuids(2); // so we have one to make the salt