diff --git a/test/core-ajax-progress.html b/test/core-ajax-progress.html
index 0d426a6..7f28a34 100644
--- a/test/core-ajax-progress.html
+++ b/test/core-ajax-progress.html
@@ -43,11 +43,6 @@
// whether to attach an event listener.
xhr['onprogress'] = null;
};
- var animationFrameFlush = function(callback) {
- requestAnimationFrame(function(){
- flush(callback);
- })
- };
var progressEvent = function(lengthComputable, loaded, total) {
var progress = new ProgressEvent('progress', {
lengthComputable: lengthComputable,
diff --git a/test/core-ajax-race.html b/test/core-ajax-race.html
index ffca971..700ad12 100644
--- a/test/core-ajax-race.html
+++ b/test/core-ajax-race.html
@@ -44,11 +44,6 @@
xhr.onCreate = function (xhr) {
requests.push(xhr);
};
- var animationFrameFlush = function(callback) {
- requestAnimationFrame(function(){
- flush(callback);
- })
- };
// Make request1, then request2. request2 returns first, followed by request1.
async.series([
@@ -56,13 +51,11 @@
ajax.url="http://example.org/request1"
cb();
},
- flush,
animationFrameFlush,
function(cb) {
ajax.url="http://example.org/request2"
cb();
},
- flush,
animationFrameFlush,
function(cb) {
requests[0].respond(200, headers, body("http://example.org/request2"));
diff --git a/test/core-ajax.html b/test/core-ajax.html
index 9180fe3..5d1f0d5 100644
--- a/test/core-ajax.html
+++ b/test/core-ajax.html
@@ -52,12 +52,7 @@
ajax.auto = true;
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){
requests[0].respond(200, headers, "test text");
cb();
@@ -80,12 +75,7 @@
ajax.auto = true;
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){
requests[0].respond(200, headers,
"" +
@@ -116,12 +106,7 @@
ajax.auto = true;
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){
requests[0].respond(200, headers,
'{"object" : {"list" : [2, 3, {"key": "value"}]}}');
@@ -147,12 +132,7 @@
ajax.auto = true;
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){
var buf = new ArrayBuffer(8*4);
var resp = new Int32Array(buf);
@@ -185,12 +165,7 @@
ajax.url = "http://example.com/auto";
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){
assert.equal(requests.length, 1);
cb();
@@ -203,12 +178,7 @@
ajax.params = {param: "value"};
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){
assert.equal(requests.length, 1);
cb();
@@ -247,24 +217,14 @@
ajax.auto = false;
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- },
+ animationFrameFlush,
function(cb){;
ajax.handleAs = 'text';
ajax.url = "http://example.com/text"
ajax.auto = true;
cb();
},
- flush,
- function(cb) {
- requestAnimationFrame(function(){
- cb();
- });
- }
+ animationFrameFlush,
], done);
responded = false;
});