Commit ea69a621 authored by Biao She's avatar Biao She Committed by Commit Bot

Don't show controls if exit VR from fullscreen mode

Bug: 767572
Change-Id: I7a9c90372c719bc423603d9e6a9a4ce33f292191
Reviewed-on: https://chromium-review.googlesource.com/677988
Commit-Queue: Biao She <bshe@chromium.org>
Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504371}
parent eb394d5d
......@@ -526,6 +526,7 @@ public class VrShellImpl
@Override
public void shutdown() {
mActivity.getFullscreenManager().removeListener(this);
mActivity.getFullscreenManager().setPersistentFullscreenMode(false);
reparentAllTabs(mActivity.getWindowAndroid());
if (mNativeVrShell != 0) {
nativeDestroy(mNativeVrShell);
......
......@@ -31,6 +31,7 @@ import org.chromium.chrome.browser.vr_shell.util.VrShellDelegateUtils;
import org.chromium.chrome.browser.vr_shell.util.VrTransitionUtils;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content.browser.test.util.DOMUtils;
import java.util.concurrent.TimeoutException;
......@@ -132,6 +133,26 @@ public class VrShellTransitionTest {
enterExitVrShell(false /* supported */);
}
/**
* Tests that we exit fullscreen mode after exiting VR from cinema mode.
*/
@Test
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
@MediumTest
public void testExitFullscreenAfterExitingVrFromCinemaMode()
throws InterruptedException, TimeoutException {
mVrTestFramework.loadUrlAndAwaitInitialization(
VrTestFramework.getHtmlTestFile("test_navigation_2d_page"), PAGE_LOAD_TIMEOUT_S);
VrTransitionUtils.forceEnterVr();
VrTransitionUtils.waitForVrEntry(POLL_TIMEOUT_LONG_MS);
DOMUtils.clickNode(mVrTestFramework.getFirstTabCvc(), "fullscreen");
mVrTestFramework.waitOnJavaScriptStep(mVrTestFramework.getFirstTabWebContents());
Assert.assertTrue(DOMUtils.isFullscreen(mVrTestFramework.getFirstTabWebContents()));
VrTransitionUtils.forceExitVr();
Assert.assertFalse(DOMUtils.isFullscreen(mVrTestFramework.getFirstTabWebContents()));
}
/**
* Tests that the reported display dimensions are correct when exiting
* from WebVR presentation to the VR browser.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment