Implement auto-suspend function for Kobo. Add test case for UIManager:_checkTasks, which should not clear _task_queue_dirty bit before looping.

This commit is contained in:
Zijie He
2016-03-18 16:33:14 -07:00
committed by Zijie He
parent ad2ccc995e
commit b86aa5a02b
4 changed files with 75 additions and 5 deletions

View File

@@ -153,4 +153,12 @@ describe("UIManager spec", function()
UIManager:_checkTasks()
assert.are.same(run_count, 2)
end)
it("should clear _task_queue_dirty bit before looping", function()
UIManager:quit()
assert.is.not_true(UIManager._task_queue_dirty)
UIManager:nextTick(function() UIManager:nextTick(noop) end)
UIManager:_checkTasks()
assert.is_true(UIManager._task_queue_dirty)
end)
end)