Skip to content

Commit

Permalink
Merge pull request #12941 from rwjblue/update-backburner
Browse files Browse the repository at this point in the history
[BUGFIX beta] Update Backburner.
  • Loading branch information
rwjblue committed Feb 10, 2016
2 parents 2397551 + a168d44 commit c81bca9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"qunit-phantom-runner": "jonkemp/qunit-phantomjs-runner#1.2.0"
},
"devDependencies": {
"backburner": "https://github.com/ebryn/backburner.js.git#22a4df33f23c40257bc49972e5833038452ded2e",
"backburner": "https://github.com/ebryn/backburner.js.git#325a969dbc7eae42dc1edfbf0ae9fb83923df5a6",
"rsvp": "https://github.com/tildeio/rsvp.js.git#3.0.20",
"router.js": "https://github.com/tildeio/router.js.git#ed45bc5c5e055af0ab875ef2c52feda792ee23e4",
"dag-map": "https://github.com/krisselden/dag-map.git#1.0.2",
Expand Down
18 changes: 10 additions & 8 deletions packages/ember-metal/tests/run_loop/later_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import run from 'ember-metal/run_loop';

var originalSetTimeout = window.setTimeout;
var originalDateValueOf = Date.prototype.valueOf;
const originalPlatform = run.backburner._platform;

function wait(callback, maxWaitCount) {
maxWaitCount = isNone(maxWaitCount) ? 100 : maxWaitCount;
Expand Down Expand Up @@ -33,6 +34,7 @@ function pauseUntil(time) {

QUnit.module('run.later', {
teardown() {
run.backburner._platform = originalPlatform;
window.setTimeout = originalSetTimeout;
Date.prototype.valueOf = originalDateValueOf;
}
Expand Down Expand Up @@ -197,13 +199,14 @@ asyncTest('setTimeout should never run with a negative wait', function() {
// happens when an expired timer callback takes a while to run,
// which is what we simulate here.
var newSetTimeoutUsed;
window.setTimeout = function() {
var wait = arguments[arguments.length - 1];
newSetTimeoutUsed = true;
ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number');
// In IE8, `setTimeout.apply` is `undefined`.
var apply = Function.prototype.apply;
return apply.apply(originalSetTimeout, [this, arguments]);
run.backburner._platform = {
setTimeout() {
var wait = arguments[arguments.length - 1];
newSetTimeoutUsed = true;
ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number');

return originalPlatform.setTimeout.apply(originalPlatform, arguments);
}
};

var count = 0;
Expand All @@ -226,7 +229,6 @@ asyncTest('setTimeout should never run with a negative wait', function() {
});

wait(function() {
window.setTimeout = originalSetTimeout;
QUnit.start();
ok(newSetTimeoutUsed, 'stub setTimeout was used');
});
Expand Down

0 comments on commit c81bca9

Please sign in to comment.