Skip to content
Snippets Groups Projects
Commit 9e974839 authored by Makoto Kato's avatar Makoto Kato
Browse files

Bug 1750142 - Support screen.orientation.lock('any') on GeckoView backend....

Bug 1750142 - Support screen.orientation.lock('any') on GeckoView backend. r=geckoview-reviewers,calu

Differential Revision: https://phabricator.services.mozilla.com/D135981
parent b894f994
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
[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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment