forked from mirrors/gecko-dev
Bug 1750142 - Support screen.orientation.lock('any') on GeckoView backend. r=geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D135981
This commit is contained in:
parent
b894f9949e
commit
9e9748390b
4 changed files with 19 additions and 2 deletions
|
|
@ -114,6 +114,10 @@ RefPtr<MozPromise<bool, bool, false>> LockScreenOrientation(
|
|||
case eScreenOrientation_LandscapeSecondary:
|
||||
case eScreenOrientation_LandscapePrimary |
|
||||
eScreenOrientation_LandscapeSecondary:
|
||||
case eScreenOrientation_PortraitPrimary |
|
||||
eScreenOrientation_PortraitSecondary |
|
||||
eScreenOrientation_LandscapePrimary |
|
||||
eScreenOrientation_LandscapeSecondary:
|
||||
case eScreenOrientation_Default: {
|
||||
java::GeckoRuntime::LocalRef runtime = java::GeckoRuntime::GetInstance();
|
||||
if (runtime != NULL) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ public class GeckoScreenOrientation {
|
|||
LANDSCAPE_PRIMARY(1 << 2),
|
||||
LANDSCAPE_SECONDARY(1 << 3),
|
||||
LANDSCAPE(LANDSCAPE_PRIMARY.value | LANDSCAPE_SECONDARY.value),
|
||||
ANY(
|
||||
PORTRAIT_PRIMARY.value
|
||||
| PORTRAIT_SECONDARY.value
|
||||
| LANDSCAPE_PRIMARY.value
|
||||
| LANDSCAPE_SECONDARY.value),
|
||||
DEFAULT(1 << 4);
|
||||
|
||||
public final short value;
|
||||
|
|
|
|||
|
|
@ -873,6 +873,8 @@ public final class GeckoRuntime implements Parcelable {
|
|||
return ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
||||
} else if (geckoOrientation == ScreenOrientation.DEFAULT.value) {
|
||||
return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||
} else if (geckoOrientation == ScreenOrientation.ANY.value) {
|
||||
return ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
||||
}
|
||||
return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
[lock-basic.html]
|
||||
prefs: [dom.screenorientation.allow-lock:true]
|
||||
expected: ERROR
|
||||
[Test that screen.orientation.lock returns a pending promise.]
|
||||
expected: FAIL
|
||||
expected:
|
||||
if (os == "android"): TIMEOUT # Bug 1750147
|
||||
FAIL
|
||||
|
||||
[Test that screen.orientation.lock returns a promise which will be fulfilled with a void value.]
|
||||
expected: FAIL
|
||||
expected:
|
||||
if (os == "android"): PASS
|
||||
FAIL
|
||||
|
||||
[Test that screen.orientation.lock() is actually async]
|
||||
expected:
|
||||
if (os == "android"): [PASS, NOTRUN]
|
||||
FAIL
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue