Commit ac761500 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Add NFC entry on native page test

Adds an automated test to cover the manual test of entering the VR
Browser on a native page via an NFC scan.

Bug: 862155
Change-Id: I1a4779a94996389b77cf15aea07f151152a16cda
Reviewed-on: https://chromium-review.googlesource.com/1187196Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585624}
parent 767d2055
......@@ -32,6 +32,7 @@ import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.ntp.IncognitoNewTabPage;
import org.chromium.chrome.browser.preferences.Preferences;
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
......@@ -536,7 +537,7 @@ public class VrBrowserTransitionTest {
/**
* Verifies that permissions granted outside of VR persist while in VR, even after the page is
* refreshed. Automation of a manutal test from https://crbug.com/861941.
* refreshed. Automation of a manual test from https://crbug.com/861941.
*/
@Test
@Restriction({RESTRICTION_TYPE_VIEWER_DAYDREAM})
......@@ -576,4 +577,22 @@ public class VrBrowserTransitionTest {
mVrBrowserTestFramework.endTest();
server.stopAndDestroyServer();
}
/**
* Verifies that an NFC scan in 2D Chrome while viewing a native page still successfully enters
* the VR browser. Automation of a manual test from https://crbug.com/862155.
*/
@Test
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
@MediumTest
public void testNfcScanOnNativePage() throws InterruptedException {
// We can't loop over all the native URLs since multiple NFC entries in a short timespan
// isn't possible. So, just pick the native history page as a suitable one.
mTestRule.loadUrl(UrlConstants.NATIVE_HISTORY_URL, PAGE_LOAD_TIMEOUT_S);
NfcSimUtils.simNfcScanUntilVrEntry(mTestRule.getActivity());
Assert.assertTrue("Browser is not in VR", VrShellDelegate.isInVr());
Assert.assertTrue("Browser entered VR, but is not on a native page",
mTestRule.getActivity().getActivityTab().isNativePage());
VrBrowserTransitionUtils.forceExitVr();
}
}
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