gecko-dev/dom/base/test/orientationcommon.js
William Chen 2318fd1af8 Bug 1131470 - Part 6: ScreenOrientation tests. r=baku
--HG--
extra : rebase_source : bce22b7614a58208b8706632661b7bebed813c87
2015-08-18 15:28:01 -07:00

22 lines
598 B
JavaScript

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();
});
});
}