mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Move kobo auto-suspension logic out of UIManager (#2933)
This commit is contained in:
@@ -18,12 +18,11 @@ describe("device module", function()
|
||||
end
|
||||
}
|
||||
require("commonrequire")
|
||||
package.unloadAll()
|
||||
end)
|
||||
|
||||
before_each(function()
|
||||
package.loaded['ffi/framebuffer_mxcfb'] = mock_fb
|
||||
package.loaded['device/kindle/device'] = nil
|
||||
package.loaded['device/kobo/device'] = nil
|
||||
mock_input = require('device/input')
|
||||
stub(mock_input, "open")
|
||||
stub(os, "getenv")
|
||||
@@ -171,7 +170,6 @@ describe("device module", function()
|
||||
stub(Device, "isKobo")
|
||||
|
||||
Device.isKobo.returns(true)
|
||||
local saved_noop = UIManager._resetAutoSuspendTimer
|
||||
UIManager:init()
|
||||
|
||||
ReaderUI:doShowReader(sample_pdf)
|
||||
@@ -185,9 +183,6 @@ describe("device module", function()
|
||||
Device.powerd.beforeSuspend:revert()
|
||||
Device.isKobo:revert()
|
||||
readerui.onFlushSettings:revert()
|
||||
UIManager._startAutoSuspend = nil
|
||||
UIManager._stopAutoSuspend = nil
|
||||
UIManager._resetAutoSuspendTimer = saved_noop
|
||||
readerui:onClose()
|
||||
end)
|
||||
end)
|
||||
@@ -251,6 +246,7 @@ describe("device module", function()
|
||||
end)
|
||||
|
||||
it("oasis should interpret orientation event", function()
|
||||
package.unload('device/kindle/device')
|
||||
io.open = function(filename, mode)
|
||||
if filename == "/proc/usid" then
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user