Commit 613b4c77 authored by ymalik's avatar ymalik Committed by Commit bot

This CL reverts the CL that reverted infobar prompts due to the compile failure

on x86/c64 bots. The problem was that VrShellDelegate.java depends on
VrFeedbackStatus.java which was only available when enable_vr was set to true.
This CL build VrFeedbackStatus as part of chrome_java_sources instead of
chrome_vr_java_sources.

Original CL: https://codereview.chromium.org/2887383002/
Revert: https://codereview.chromium.org/2896933002/

Revert "Revert "Show an infobar prompting the user to enter feedback when they exit VR""

This reverts commit 007ec6f3.

TBR=mthiesse
BUG=706438

Review-Url: https://codereview.chromium.org/2899013002
Cr-Commit-Position: refs/heads/master@{#473947}
parent 7c3794d8
......@@ -542,6 +542,7 @@ if (enable_vr) {
"javatests/src/org/chromium/chrome/browser/vr_shell/EmulatedVrController.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/MockVrCoreVersionCheckerImpl.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/MockVrDaydreamApi.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/VrFeedbackInfoBarTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/VrShellTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/VrShellNavigationTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/VrTestRule.java",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.vr_shell;
import org.chromium.base.ContextUtils;
/**
* Gets and sets preferences related to the status of the Vr feedback infobar.
*/
public class VrFeedbackStatus {
public static final String VR_FEEDBACK_OPT_OUT = "VR_FEEDBACK_OPT_OUT";
public static final String VR_EXIT_TO_2D_COUNT = "VR_EXIT_TO_2D_COUNT";
/**
* Sets the "opted out of entering VR feedback" preference.
* @param optOut Whether the VR feedback option has been opted-out of.
*/
public static void setFeedbackOptOut(boolean optOut) {
ContextUtils.getAppSharedPreferences()
.edit()
.putBoolean(VR_FEEDBACK_OPT_OUT, optOut)
.apply();
}
/**
* Returns whether the user opted out of entering feedback for their VR experience.
*/
public static boolean getFeedbackOptOut() {
return ContextUtils.getAppSharedPreferences().getBoolean(VR_FEEDBACK_OPT_OUT, false);
}
/**
* Sets the "exited VR mode into 2D browsing" preference.
* @param count The number of times the user exited VR and entered 2D browsing mode
*/
public static void setUserExitedAndEntered2DCount(int count) {
ContextUtils.getAppSharedPreferences().edit().putInt(VR_EXIT_TO_2D_COUNT, count).apply();
}
/**
* Returns the number of times the user has exited VR mode and entered the 2D browsing
* mode.
*/
public static int getUserExitedAndEntered2DCount() {
return ContextUtils.getAppSharedPreferences().getInt(VR_EXIT_TO_2D_COUNT, 0);
}
}
\ No newline at end of file
......@@ -94,6 +94,9 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
private static final long REENTER_VR_TIMEOUT_MS = 1000;
// TODO(ymalik): This should be configurable via Finch.
private static final int FEEDBACK_FREQUENCY = 10;
private static final int VR_SYSTEM_UI_FLAGS = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN
......@@ -111,6 +114,9 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
@VrSupportLevel
private int mVrSupportLevel;
// How often to prompt the user to enter VR feedback.
private int mFeedbackFrequency;
private final VrClassesWrapper mVrClassesWrapper;
private VrShell mVrShell;
private NonPresentingGvrContext mNonPresentingGvrContext;
......@@ -141,6 +147,10 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
// content to call requestPresent.
private boolean mAutopresentWebVr;
// Set to true if performed VR browsing at least once. That is, this was not simply a WebVr
// presentation experience.
private boolean mVrBrowserUsed;
private static final class VrBroadcastReceiver extends BroadcastReceiver {
private final WeakReference<ChromeActivity> mTargetActivity;
......@@ -338,6 +348,10 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
return false;
}
private static boolean activitySupportsExitFeedback(Activity activity) {
return activity instanceof ChromeTabbedActivity;
}
/**
* @return A helper class for creating VR-specific classes that may not be available at compile
* time.
......@@ -412,6 +426,7 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
mPaused = ApplicationStatus.getStateForActivity(activity) != ActivityState.RESUMED;
updateVrSupportLevel();
mNativeVrShellDelegate = nativeInit();
mFeedbackFrequency = FEEDBACK_FREQUENCY;
Choreographer choreographer = Choreographer.getInstance();
choreographer.postFrameCallback(new FrameCallback() {
@Override
......@@ -446,7 +461,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
} else {
// We should never reach this state currently, but just in case...
assert false;
shutdownVr(true, false);
shutdownVr(true /* disableVrMode */, false /* canReenter */,
false /* stayingInChrome */);
}
}
if (!activitySupportsPresentation(activity)) return;
......@@ -564,7 +580,11 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
addVrViews();
mVrShell.initializeNative(mActivity.getActivityTab(), mRequestedWebVr || tentativeWebVrMode,
mActivity instanceof CustomTabActivity);
mVrShell.setWebVrModeEnabled(mRequestedWebVr || tentativeWebVrMode);
boolean webVrMode = mRequestedWebVr || tentativeWebVrMode;
mVrShell.setWebVrModeEnabled(webVrMode);
// We're entering VR, but not in WebVr mode.
mVrBrowserUsed = !webVrMode;
// onResume needs to be called on GvrLayout after initialization to make sure DON flow work
// properly.
......@@ -711,7 +731,10 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
return false;
}
mVrShell.setWebVrModeEnabled(false);
shutdownVr(true, false);
shutdownVr(
true /* disableVrMode */, false /* canReenter */, true /* stayingInChrome */);
} else {
mVrBrowserUsed = true;
}
return true;
}
......@@ -791,13 +814,13 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
// TODO(mthiesse): When VR Shell lives in its own activity, and integrates with Daydream
// home, pause instead of exiting VR here. For now, because VR Apps shouldn't show up in the
// non-VR recents, and we don't want ChromeTabbedActivity disappearing, exit VR.
shutdownVr(true, true);
shutdownVr(true /* disableVrMode */, true /* canReenter */, false /* stayingInChrome */);
}
private boolean onBackPressedInternal() {
if (mVrSupportLevel == VR_NOT_AVAILABLE) return false;
if (!mInVr) return false;
shutdownVr(true, false);
shutdownVr(true /* disableVrMode */, false /* canReenter */, true /* stayingInChrome */);
return true;
}
......@@ -813,7 +836,9 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
if (!success && mVrDaydreamApi.exitFromVr(EXIT_VR_RESULT, new Intent())) return;
mShowingDaydreamDoff = false;
shutdownVr(true, false);
shutdownVr(true /* disableVrMode */, false /* canReenter */,
!mExitingCct /* stayingInChrome */);
if (mExitingCct) ((CustomTabActivity) mActivity).finishAndClose(false);
mExitingCct = false;
}
......@@ -860,7 +885,8 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
/**
* Exits VR Shell, performing all necessary cleanup.
*/
/* package */ void shutdownVr(boolean setVrMode, boolean canReenter) {
/* package */ void shutdownVr(
boolean disableVrMode, boolean canReenter, boolean stayingInChrome) {
if (!mInVr) return;
if (mShowingDaydreamDoff) {
onExitVrResult(true);
......@@ -879,7 +905,9 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
removeVrViews();
destroyVrShell();
mActivity.getFullscreenManager().setPositionsForTabToNonFullscreen();
if (setVrMode) mVrClassesWrapper.setVrModeEnabled(mActivity, false);
if (disableVrMode) mVrClassesWrapper.setVrModeEnabled(mActivity, false);
promptForFeedbackIfNeeded(stayingInChrome);
}
/* package */ void showDoffAndExitVr() {
......@@ -888,7 +916,7 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
mShowingDaydreamDoff = true;
return;
}
shutdownVr(true, false);
shutdownVr(true /* disableVrMode */, false /* canReenter */, true /* stayingInChrome */);
}
/* package */ void exitCct() {
......@@ -901,7 +929,55 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
return;
}
}
((CustomTabActivity) mActivity).finishAndClose(false);
}
private static void promptForFeedback(Tab tab) {
final ChromeActivity activity = tab.getActivity();
SimpleConfirmInfoBarBuilder.Listener listener = new SimpleConfirmInfoBarBuilder.Listener() {
@Override
public void onInfoBarDismissed() {}
@Override
public boolean onInfoBarButtonClicked(boolean isPrimary) {
if (isPrimary) {
// TODO(ymalik): This just calls Chrome's help and feedback page for now. It
// should instead start a VR-specific Feedback activity.
activity.startHelpAndFeedback(activity.getActivityTab(), "vrExitFeedback");
} else {
VrFeedbackStatus.setFeedbackOptOut(true);
}
return false;
}
};
SimpleConfirmInfoBarBuilder.create(tab, listener,
InfoBarIdentifier.VR_FEEDBACK_INFOBAR_ANDROID, R.drawable.vr_services,
activity.getString(R.string.vr_shell_feedback_infobar_description),
activity.getString(R.string.vr_shell_feedback_infobar_feedback_button),
activity.getString(R.string.no_thanks), true /* autoExpire */);
}
/**
* Prompts the user to enter feedback for their VR Browsing experience.
*/
private void promptForFeedbackIfNeeded(boolean stayingInChrome) {
// We only prompt for feedback if:
// 1) The user hasn't explicitly opted-out of it in the past
// 2) The user has performed VR browsing
// 3) The user is exiting VR and going back into 2D Chrome
// 4) Every n'th visit (where n = mFeedbackFrequency)
if (!activitySupportsExitFeedback(mActivity)) return;
if (!stayingInChrome) return;
if (VrFeedbackStatus.getFeedbackOptOut()) return;
if (!mVrBrowserUsed) return;
int exitCount = VrFeedbackStatus.getUserExitedAndEntered2DCount();
VrFeedbackStatus.setUserExitedAndEntered2DCount((exitCount + 1) % mFeedbackFrequency);
if (exitCount > 0) return;
promptForFeedback(mActivity.getActivityTab());
}
private static boolean isVrCoreCompatible(
......@@ -1038,6 +1114,14 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
mVrCoreVersionChecker = versionChecker;
}
/**
* @param frequency Sets how often to show the feedback prompt.
*/
@VisibleForTesting
public void setFeedbackFrequencyForTesting(int frequency) {
mFeedbackFrequency = frequency;
}
/**
* @return Pointer to the native VrShellDelegate object.
*/
......@@ -1048,7 +1132,7 @@ public class VrShellDelegate implements ApplicationStatus.ActivityStateListener,
private void destroy() {
if (sInstance == null) return;
shutdownVr(false, false);
shutdownVr(false /* disableVrMode */, false /* canReenter */, false /* stayingInChrome */);
if (mNativeVrShellDelegate != 0) nativeDestroy(mNativeVrShellDelegate);
mNativeVrShellDelegate = 0;
ApplicationStatus.unregisterActivityStateListener(this);
......
......@@ -136,7 +136,8 @@ public class VrShellImpl
getUiLayout().setCloseButtonListener(new Runnable() {
@Override
public void run() {
mDelegate.shutdownVr(true, false);
mDelegate.shutdownVr(true /* disableVrMode */, false /* canReenter */,
true /* stayingInChrome */);
}
});
......
......@@ -1148,6 +1148,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/vr_shell/VrClassesWrapper.java",
"java/src/org/chromium/chrome/browser/vr_shell/VrCoreVersionChecker.java",
"java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApi.java",
"java/src/org/chromium/chrome/browser/vr_shell/VrFeedbackStatus.java",
"java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java",
"java/src/org/chromium/chrome/browser/vr_shell/VrShell.java",
"java/src/org/chromium/chrome/browser/webapps/ActivityAssigner.java",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.vr_shell;
import static org.chromium.chrome.browser.vr_shell.VrTestRule.PAGE_LOAD_TIMEOUT_S;
import static org.chromium.chrome.browser.vr_shell.VrUtils.POLL_TIMEOUT_LONG_MS;
import static org.chromium.chrome.browser.vr_shell.VrUtils.POLL_TIMEOUT_SHORT_MS;
import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_DAYDREAM;
import android.support.test.filters.MediumTest;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.infobar.InfoBar;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.chrome.test.util.InfoBarUtil;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content_public.browser.WebContents;
import java.util.List;
import java.util.concurrent.TimeoutException;
/**
* Tests for the infobar that prompts the user to enter feedback on their VR browsing experience.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG, "enable-features=VrShell",
"enable-webvr"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
public class VrFeedbackInfoBarTest {
@Rule
public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
@Rule
public VrTestRule mVrTestRule = new VrTestRule();
private static final String TEST_PAGE_2D_URL =
VrTestRule.getHtmlTestFile("test_navigation_2d_page");
private static final String TEST_PAGE_WEBVR_URL =
VrTestRule.getHtmlTestFile("test_requestPresent_enters_vr");
private ContentViewCore mFirstTabCvc;
private WebContents mFirstTabWebContents;
public int loadUrlAndWait(String url, long secondsToWait)
throws IllegalArgumentException, InterruptedException {
int result = mActivityTestRule.loadUrl(url, secondsToWait);
mVrTestRule.waitOnJavaScriptStep(
mActivityTestRule.getActivity().getActivityTab().getWebContents());
return result;
}
@Before
public void setUp() throws Exception {
mActivityTestRule.startMainActivityOnBlankPage();
mFirstTabWebContents = mActivityTestRule.getActivity().getActivityTab().getWebContents();
mFirstTabCvc = mActivityTestRule.getActivity().getActivityTab().getContentViewCore();
Assert.assertFalse(VrFeedbackStatus.getFeedbackOptOut());
}
private void clickInfoBarButton(final boolean primary) {
final List<InfoBar> infoBars = mActivityTestRule.getInfoBars();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
if (primary) {
InfoBarUtil.clickPrimaryButton(infoBars.get(0));
} else {
InfoBarUtil.clickSecondaryButton(infoBars.get(0));
}
}
});
InfoBarUtil.waitUntilNoInfoBarsExist(mActivityTestRule.getInfoBars());
}
private void clickInfobarCloseButton() {
final List<InfoBar> infoBars = mActivityTestRule.getInfoBars();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
InfoBarUtil.clickCloseButton(infoBars.get(0));
}
});
InfoBarUtil.waitUntilNoInfoBarsExist(mActivityTestRule.getInfoBars());
}
private void assertState(boolean isInVr, boolean isInfobarVisible) {
Assert.assertEquals("Browser is in VR", isInVr, VrShellDelegate.isInVr());
Assert.assertEquals("Infobar is visible", isInfobarVisible,
VrUtils.isInfoBarPresent(
mActivityTestRule.getActivity().getWindow().getDecorView()));
}
private void enterThenExitVr() {
VrUtils.forceEnterVr();
VrUtils.waitForVrSupported(POLL_TIMEOUT_LONG_MS);
assertState(true /* isInVr */, false /* isInfobarVisible */);
VrUtils.forceExitVr(VrUtils.getVrShellDelegateInstance());
}
/**
* Tests that we respect the feedback frequency when showing the feedback prompt.
*/
@Test
@MediumTest
public void testFeedbackFrequency() throws InterruptedException, TimeoutException {
loadUrlAndWait(TEST_PAGE_2D_URL, PAGE_LOAD_TIMEOUT_S);
// Set frequency of infobar to every 2nd time.
VrUtils.getVrShellDelegateInstance().setFeedbackFrequencyForTesting(2);
// Verify that the Feedback infobar is visible when exiting VR.
enterThenExitVr();
assertState(false /* isInVr */, true /* isInfobarVisible */);
clickInfobarCloseButton();
// Feedback infobar shouldn't show up this time.
enterThenExitVr();
assertState(false /* isInVr */, false /* isInfobarVisible */);
// Feedback infobar should show up again.
enterThenExitVr();
assertState(false /* isInVr */, true /* isInfobarVisible */);
clickInfobarCloseButton();
}
/**
* Tests that we don't show the feedback prompt when the user has opted-out.
*/
@Test
@MediumTest
public void testFeedbackOptOut() throws InterruptedException, TimeoutException {
loadUrlAndWait(TEST_PAGE_2D_URL, PAGE_LOAD_TIMEOUT_S);
// Show infobar every time.
VrUtils.getVrShellDelegateInstance().setFeedbackFrequencyForTesting(1);
// The infobar should show the first time.
enterThenExitVr();
assertState(false /* isInVr */, true /* isInfobarVisible */);
// Opt-out of seeing the infobar.
clickInfoBarButton(false /* primary */);
Assert.assertTrue(VrFeedbackStatus.getFeedbackOptOut());
// The infobar should not show because the user opted out.
enterThenExitVr();
assertState(false /* isInVr */, false /* isInfobarVisible */);
}
/**
* Tests that we only show the feedback prompt when the user has actually used the VR browser.
*/
@Test
@MediumTest
public void testFeedbackOnlyOnVrBrowsing() throws InterruptedException, TimeoutException {
// Enter VR presentation mode.
mActivityTestRule.loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S);
Assert.assertTrue("VRDisplay found", mVrTestRule.vrDisplayFound(mFirstTabWebContents));
mVrTestRule.enterPresentationAndWait(mFirstTabCvc, mFirstTabWebContents);
assertState(true /* isInVr */, false /* isInfobarVisible */);
Assert.assertTrue(VrShellDelegate.getVrShellForTesting().getWebVrModeEnabled());
// Exiting VR should not prompt for feedback since the no VR browsing was performed.
VrUtils.forceExitVr(VrUtils.getVrShellDelegateInstance());
assertState(false /* isInVr */, false /* isInfobarVisible */);
}
/**
* Tests that we show the prompt if the VR browser is used after exiting presentation mode.
*/
@Test
@MediumTest
public void testExitPresentationInVr() throws InterruptedException, TimeoutException {
// Enter VR presentation mode.
mActivityTestRule.loadUrl(TEST_PAGE_WEBVR_URL, PAGE_LOAD_TIMEOUT_S);
Assert.assertTrue("VRDisplay found", mVrTestRule.vrDisplayFound(mFirstTabWebContents));
mVrTestRule.enterPresentationAndWait(mFirstTabCvc, mFirstTabWebContents);
assertState(true /* isInVr */, false /* isInfobarVisible */);
Assert.assertTrue(VrShellDelegate.getVrShellForTesting().getWebVrModeEnabled());
// Exit presentation mode by navigating to a different url.
ChromeTabUtils.waitForTabPageLoaded(
mActivityTestRule.getActivity().getActivityTab(), new Runnable() {
@Override
public void run() {
mVrTestRule.runJavaScriptOrFail(
"window.location.href = '" + TEST_PAGE_2D_URL + "';",
POLL_TIMEOUT_SHORT_MS, mFirstTabWebContents);
}
}, POLL_TIMEOUT_LONG_MS);
// Exiting VR should prompt for feedback since 2D browsing was performed after.
VrUtils.forceExitVr(VrUtils.getVrShellDelegateInstance());
assertState(false /* isInVr */, true /* isInfobarVisible */);
}
}
......@@ -116,6 +116,9 @@ public class VrShellNavigationTest {
VrShellDelegate.getVrShellForTesting().getWebVrModeEnabled());
Assert.assertEquals("Browser is in fullscreen",
fullscreenMode == FullscreenMode.FULLSCREENED, DOMUtils.isFullscreen(wc));
// Feedback infobar should never show up during navigations.
Assert.assertFalse(VrUtils.isInfoBarPresent(
mActivityTestRule.getActivity().getWindow().getDecorView()));
}
public int loadUrl(String url, long secondsToWait)
......
......@@ -85,7 +85,8 @@ public class VrUtils {
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
vrDelegate.shutdownVr(false /* isPausing */, false /* showTransition */);
vrDelegate.shutdownVr(true /* disableVrMode */, false /* canReenter */,
true /* stayingInChrome */);
}
});
}
......@@ -145,12 +146,13 @@ public class VrUtils {
}
/**
* Determines whether an InfoBar prompting the user to install/update VR
* Services is present.
* Determines is there is any InfoBar present in the given View hierarchy.
* @param parentView The View to start the search in
* @return Whether the InfoBar is present
*/
public static boolean isUpdateInstallInfoBarPresent(View parentView) {
public static boolean isInfoBarPresent(View parentView) {
// TODO(ymalik): This will return true if any infobar is present. Is it
// possible to determine the type of infobar present (e.g. Feedback)?
// InfoBarContainer will be present regardless of whether an InfoBar
// is actually there, but InfoBarLayout is only present if one is
// currently showing.
......@@ -159,7 +161,7 @@ public class VrUtils {
} else if (parentView instanceof ViewGroup) {
ViewGroup group = (ViewGroup) parentView;
for (int i = 0; i < group.getChildCount(); i++) {
if (isUpdateInstallInfoBarPresent(group.getChildAt(i))) return true;
if (isInfoBarPresent(group.getChildAt(i))) return true;
}
}
return false;
......
......@@ -199,7 +199,7 @@ public class WebVrTest {
if (checkerReturnValue == VrCoreVersionChecker.VR_READY) {
Assert.assertTrue(displayFound, mVrTestRule.vrDisplayFound(mFirstTabWebContents));
Assert.assertFalse(barPresent,
VrUtils.isUpdateInstallInfoBarPresent(
VrUtils.isInfoBarPresent(
mActivityTestRule.getActivity().getWindow().getDecorView()));
} else if (checkerReturnValue == VrCoreVersionChecker.VR_OUT_OF_DATE
|| checkerReturnValue == VrCoreVersionChecker.VR_NOT_AVAILABLE) {
......@@ -218,7 +218,7 @@ public class WebVrTest {
}
Assert.assertFalse(displayFound, mVrTestRule.vrDisplayFound(mFirstTabWebContents));
Assert.assertTrue(barPresent,
VrUtils.isUpdateInstallInfoBarPresent(
VrUtils.isInfoBarPresent(
mActivityTestRule.getActivity().getWindow().getDecorView()));
TextView tempView = (TextView) mActivityTestRule.getActivity()
.getWindow()
......@@ -233,7 +233,7 @@ public class WebVrTest {
} else if (checkerReturnValue == VrCoreVersionChecker.VR_NOT_SUPPORTED) {
Assert.assertFalse(displayFound, mVrTestRule.vrDisplayFound(mFirstTabWebContents));
Assert.assertFalse(barPresent,
VrUtils.isUpdateInstallInfoBarPresent(
VrUtils.isInfoBarPresent(
mActivityTestRule.getActivity().getWindow().getDecorView()));
} else {
Assert.fail(
......
......@@ -146,6 +146,7 @@ class InfoBarDelegate {
AUTOMATION_INFOBAR_DELEGATE = 73,
VR_SERVICES_UPGRADE_ANDROID = 74,
READER_MODE_INFOBAR_ANDROID = 75,
VR_FEEDBACK_INFOBAR_ANDROID = 76,
};
// Describes navigation events, used to decide whether infobars should be
......
......@@ -18930,6 +18930,7 @@ uploading your change for review. These are checked by presubmit scripts.
<int value="73" label="AUTOMATION_INFOBAR_DELEGATE"/>
<int value="74" label="VR_SERVICES_UPGRADE_ANDROID"/>
<int value="75" label="READER_MODE_INFOBAR_ANDROID"/>
<int value="76" label="VR_FEEDBACK_INFOBAR_ANDROID"/>
</enum>
<enum name="InfoBarResponse" type="int">
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