aboutsummaryrefslogtreecommitdiffstats
path: root/test/caldav/xhr_test.js
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-07-20 09:13:46 -0700
committerJames Lal <james@lightsofapollo.com>2012-07-20 09:13:46 -0700
commit08a6ce10660e4436d48ad85075d6d092431b426e (patch)
treebb3a7905043d2ae3a15f8b3da6962d8279e1e33d /test/caldav/xhr_test.js
parent5a97196b49640117c546ad59cbfa31f974259f0b (diff)
downloadjsCalDAV-08a6ce10660e4436d48ad85075d6d092431b426e.tar.gz
global xhr constructor options can now be set ( for system xhr in b2g)
Diffstat (limited to 'test/caldav/xhr_test.js')
-rw-r--r--test/caldav/xhr_test.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/caldav/xhr_test.js b/test/caldav/xhr_test.js
index c442852..1082958 100644
--- a/test/caldav/xhr_test.js
+++ b/test/caldav/xhr_test.js
@@ -24,6 +24,29 @@ suite('webacls/xhr', function() {
assert.equal(subject.method, 'POST');
});
+ suite('with global args', function() {
+ var old;
+ var opts = { system: true };
+
+ setup(function() {
+ var old = Xhr.prototype.globalXhrOptions;
+ Xhr.prototype.globalXhrOptions = opts;
+ });
+
+ teardown(function() {
+ Xhr.prototype.globalXhrOptions = old;
+ });
+
+ test('constructed xhr', function() {
+ var subject = new Xhr({
+ method: 'POST',
+ xhrClass: FakeXhr
+ });
+ subject.send(function() {});
+ assert.ok(subject.xhr);
+ assert.equal(subject.xhr.constructorArgs[0], opts);
+ });
+ });
});
suite('.abort', function() {