diff --git a/core-ajax.html b/core-ajax.html
index 6c6a885..721ad0d 100644
--- a/core-ajax.html
+++ b/core-ajax.html
@@ -271,7 +271,7 @@
lengthComputable: progress.lengthComputable,
loaded: progress.loaded,
total: progress.total
- }
+ };
this.progress = progressProxy;
},
@@ -408,7 +408,7 @@
} else {
this.progress = {
lengthComputable: false,
- }
+ };
}
}
return this.activeRequest;
diff --git a/test/core-ajax-progress.html b/test/core-ajax-progress.html
index 7f28a34..2c1119b 100644
--- a/test/core-ajax-progress.html
+++ b/test/core-ajax-progress.html
@@ -35,9 +35,9 @@
var headers = {
"Content-Type": "text/json"
};
- var body = '{"content": "plentiful"}'
+ var body = '{"content": "plentiful"}';
var requests = this.requests = [];
- xhr.onCreate = function (xhr) {
+ xhr.onCreate = function(xhr) {
requests.push(xhr);
// Polymer inspects the xhr object for the precense of onprogress to determine
// whether to attach an event listener.
@@ -50,7 +50,7 @@
total: total
});
return progress;
- }
+ };
// Fake a file download by sending multiple progress events.
async.series([
diff --git a/test/core-ajax-race.html b/test/core-ajax-race.html
index 700ad12..09d8017 100644
--- a/test/core-ajax-race.html
+++ b/test/core-ajax-race.html
@@ -41,19 +41,19 @@
return '{"url": "' + url + '"}';
};
var requests = [];
- xhr.onCreate = function (xhr) {
+ xhr.onCreate = function(xhr) {
requests.push(xhr);
};
// Make request1, then request2. request2 returns first, followed by request1.
async.series([
function(cb) {
- ajax.url="http://example.org/request1"
+ ajax.url = "http://example.org/request1";
cb();
},
animationFrameFlush,
function(cb) {
- ajax.url="http://example.org/request2"
+ ajax.url = "http://example.org/request2";
cb();
},
animationFrameFlush,
diff --git a/test/core-ajax.html b/test/core-ajax.html
index ea21f09..40ffc5a 100644
--- a/test/core-ajax.html
+++ b/test/core-ajax.html
@@ -40,43 +40,43 @@
requests = [];
});
suite('handleAs', function() {
- suite('text', function(){
+ suite('text', function() {
var headers = {
"Content-Type": "text/plain"
};
- setup(function(done){
+ setup(function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.handleAs = 'text';
- ajax.url = "http://example.com/text"
+ ajax.url = "http://example.com/text";
ajax.auto = true;
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
requests[0].respond(200, headers, "test text");
cb();
}
], done);
});
- test('Raw text should pass through', function(){
- assert.equal(ajax.response, "test text")
+ test('Raw text should pass through', function() {
+ assert.equal(ajax.response, "test text");
});
});
- suite('xml', function(){
+ suite('xml', function() {
var headers = {
"Content-Type": "text/xml"
};
- setup(function(done){
+ setup(function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.handleAs = 'xml';
- ajax.url = "http://example.com/xml"
+ ajax.url = "http://example.com/xml";
ajax.auto = true;
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
requests[0].respond(200, headers,
"" +
"AJ" +
@@ -88,52 +88,52 @@
}
], done);
});
- test('XML should be returned with queryable structure', function(){
+ test('XML should be returned with queryable structure', function() {
var q = ajax.response.querySelector("note body q");
assert.equal(q.childNodes[0].textContent, "Feed me!");
var to = ajax.response.querySelector("to");
assert.equal(to.childNodes[0].textContent, "AJ");
})});
- suite('json', function(){
+ suite('json', function() {
var headers = {
"Content-Type": "text/json"
};
- setup(function(done){
+ setup(function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.handleAs = 'json';
- ajax.url = "http://example.com/json"
+ ajax.url = "http://example.com/json";
ajax.auto = true;
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
requests[0].respond(200, headers,
'{"object" : {"list" : [2, 3, {"key": "value"}]}}');
cb();
}
], done);
});
- test('JSON should be returned as an Object', function(){
+ test('JSON should be returned as an Object', function() {
var r = ajax.response;
assert.equal(r.object.list[1], 3);
assert.equal(r.object.list[2].key, "value");
});
});
- suite('arraybuffer', function(){
+ suite('arraybuffer', function() {
var headers = {
"Content-Type": "text/plain"
};
- setup(function(done){
+ setup(function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.handleAs = 'arraybuffer';
- ajax.url = "http://example.com/data"
+ ajax.url = "http://example.com/data";
ajax.auto = true;
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
var buf = new ArrayBuffer(8*4);
var resp = new Int32Array(buf);
resp[3] = 12;
@@ -144,7 +144,7 @@
}
], done);
});
- test('arraybuffer response should be passed through', function(){
+ test('arraybuffer response should be passed through', function() {
var r = ajax.response;
var ints = new Int32Array(r);
assert.equal(ints[3], 12);
@@ -155,67 +155,67 @@
suite('document', function(){});
});
suite('auto', function() {
- suiteSetup(function(){
- ajax.url = "http://example.com/"
+ suiteSetup(function() {
+ ajax.url = "http://example.com/";
ajax.auto = true;
});
- test('url change should trigger request', function(done){
+ test('url change should trigger request', function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.url = "http://example.com/auto";
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
assert.equal(requests.length, 1);
cb();
}
], done);
});
- test('params change should trigger request', function(done){
+ test('params change should trigger request', function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.params = {param: "value"};
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
assert.equal(requests.length, 1);
cb();
}
], done);
});
- test('body change should trigger request', function(done){
+ test('body change should trigger request', function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.method = "POST";
ajax.body = "bodystuff";
cb();
},
animationFrameFlush,
- function(cb){
+ function(cb) {
assert.equal(requests.length, 1);
cb();
}
], done);
});
});
- suite('events', function(){
+ suite('events', function() {
var headers = {
"Content-Type": "text/plain"
};
var body = "somebodytext";
var responded;
- setup(function(done){
+ setup(function(done) {
async.series([
- function(cb){
+ function(cb) {
ajax.auto = false;
cb();
},
animationFrameFlush,
- function(cb){;
+ function(cb) {
ajax.handleAs = 'text';
- ajax.url = "http://example.com/text"
+ ajax.url = "http://example.com/text";
ajax.auto = true;
cb();
},
@@ -223,17 +223,17 @@
], done);
responded = false;
});
- suite('core-response', function(){
- test('core-response should be fired on success', function(done){
- window.addEventListener('core-response', function(response, xhr){
+ suite('core-response', function() {
+ test('core-response should be fired on success', function(done) {
+ window.addEventListener('core-response', function(response, xhr) {
responded = true;
});
requests[0].respond(200, headers, body);
assert.isTrue(responded);
done();
});
- test('core-response should not be fired on failure', function(done){
- window.addEventListener('core-response', function(response, xhr){
+ test('core-response should not be fired on failure', function(done) {
+ window.addEventListener('core-response', function(response, xhr) {
responded = true;
});
requests[0].respond(404, headers, body);
@@ -241,18 +241,18 @@
done();
});
});
- suite('core-error', function(){
- test('core-error should be fired on failure', function(done){
- window.addEventListener('core-error', function(response, xhr){
+ suite('core-error', function() {
+ test('core-error should be fired on failure', function(done) {
+ window.addEventListener('core-error', function(response, xhr) {
responded = true;
});
requests[0].respond(404, headers, body);
assert.isTrue(responded);
done();
});
- test('core-error should not be fired on success', function(done){
+ test('core-error should not be fired on success', function(done) {
var responded = false;
- window.addEventListener('core-error', function(response, xhr){
+ window.addEventListener('core-error', function(response, xhr) {
responded = true;
});
requests[0].respond(200, headers, body);
@@ -260,18 +260,18 @@
done();
});
});
- suite('core-complete', function(){
- test('core-complete should be fired on success', function(done){
- window.addEventListener('core-complete', function(response, xhr){
+ suite('core-complete', function() {
+ test('core-complete should be fired on success', function(done) {
+ window.addEventListener('core-complete', function(response, xhr) {
responded = true;
});
requests[0].respond(200, headers, body);
assert.isTrue(responded);
done();
});
- test('core-complete should be fired on failure', function(done){
+ test('core-complete should be fired on failure', function(done) {
var responded = false;
- window.addEventListener('core-complete', function(response, xhr){
+ window.addEventListener('core-complete', function(response, xhr) {
responded = true;
});
requests[0].respond(404, headers, body);