mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
2318fd1af8
--HG-- extra : rebase_source : bce22b7614a58208b8706632661b7bebed813c87
22 lines
598 B
JavaScript
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();
|
|
});
|
|
});
|
|
}
|