diff options
Diffstat (limited to 'apps/system/test/unit/mock_navigator_wake_lock.js')
-rw-r--r-- | apps/system/test/unit/mock_navigator_wake_lock.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/apps/system/test/unit/mock_navigator_wake_lock.js b/apps/system/test/unit/mock_navigator_wake_lock.js deleted file mode 100644 index c9ff845..0000000 --- a/apps/system/test/unit/mock_navigator_wake_lock.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -(function() { - var lastWakeLock, - throwAtNextUnlock; - - function mnwl_requestWakeLock(lock) { - lastWakeLock = { - released: false, - topic: lock, - unlock: function() { - if (throwAtNextUnlock) { - throwAtNextUnlock = false; - throw "NS_ERROR_DOM_INVALID_STATE_ERR"; - } - - this.released = true; - } - }; - return lastWakeLock; - } - - function mnwl_teardown() { - lastWakeLock = undefined; - throwAtNextUnlock = undefined; - } - - function mnwl_throwAtNextUnlock() { - throwAtNextUnlock = true; - } - - window.MockNavigatorWakeLock = { - requestWakeLock: mnwl_requestWakeLock, - mTeardown: mnwl_teardown, - mThrowAtNextUnlock: mnwl_throwAtNextUnlock, - get mLastWakeLock() { - return lastWakeLock; - } - }; - -})(); |