diff options
Diffstat (limited to 'dom/base/test/orientationcommon.js')
-rw-r--r-- | dom/base/test/orientationcommon.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dom/base/test/orientationcommon.js b/dom/base/test/orientationcommon.js new file mode 100644 index 000000000..2d87cf720 --- /dev/null +++ b/dom/base/test/orientationcommon.js @@ -0,0 +1,21 @@ +function specialPowersLock(orientation) { + return new Promise(function(resolve, reject) { + SpecialPowers.pushPrefEnv({ + 'set': [ ["dom.screenorientation.testing.non_fullscreen_lock_allow", true] ] + }, function() { + var p = screen.orientation.lock(orientation); + resolve(p); + }); + }); +} + +function specialPowersUnlock() { + return new Promise(function(resolve, reject) { + SpecialPowers.pushPrefEnv({ + 'set': [ ["dom.screenorientation.testing.non_fullscreen_lock_allow", true] ] + }, function() { + screen.orientation.unlock(); + resolve(); + }); + }); +} |