summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/changes.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
index f5a3e149..d805d6cd 100644
--- a/share/www/script/test/changes.js
+++ b/share/www/script/test/changes.js
@@ -10,6 +10,12 @@
// License for the specific language governing permissions and limitations under
// the License.
+function jsonp(obj) {
+ T(jsonp_flag == 0);
+ T(obj.results.length == 1 && obj.last_seq==1)
+ jsonp_flag = 1;
+}
+
couchTests.changes = function(debug) {
var db = new CouchDB("test_suite_db");
db.deleteDb();
@@ -30,6 +36,13 @@ couchTests.changes = function(debug) {
T(resp.results.length == 1 && resp.last_seq==1)
T(resp.results[0].changes[0].rev == docFoo._rev)
+ // test with callback
+ var xhr = CouchDB.request("GET", "/test_suite_db/_changes?callback=jsonp");
+ T(xhr.status == 200);
+ jsonp_flag = 0;
+ eval(xhr.responseText);
+ T(jsonp_flag == 1);
+
req = CouchDB.request("GET", "/test_suite_db/_changes?continuous=true&timeout=10");
var resp = JSON.parse(req.responseText);