[Finishes #40853563] Allowed the DelayedFunctionScheduler to support strings that are eval'd

This commit is contained in:
Greg Cobb and JR Boyens
2013-07-18 13:57:51 -07:00
parent f637c1f833
commit 3e2d9baec2
3 changed files with 31 additions and 2 deletions

View File

@@ -12,6 +12,17 @@ describe("DelayedFunctionScheduler", function() {
expect(fn).toHaveBeenCalled();
});
it("schedules a string for later execution", function() {
var scheduler = new j$.DelayedFunctionScheduler(),
strfn = "window.horrible = true;";
scheduler.scheduleFunction(strfn, 0);
scheduler.tick(0);
expect(window.horrible).toEqual(true);
});
it("#tick defaults to 0", function() {
var scheduler = new j$.DelayedFunctionScheduler(),
fn = jasmine.createSpy('fn');