Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1031)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java

Issue 2865463003: Tracks GVR version crossed with headset type using UMA. (Closed)
Patch Set: Fixed comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
index 2d8da54994e72539716cc98367b7346da0b886b1..70e437d125a0e1eeea4c44d2a5f568ed3539ce21 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
@@ -179,26 +179,26 @@ public class WebVrTest {
* Helper function to run the tests checking for the upgrade/install InfoBar being present since
* all that differs is the value returned by VrCoreVersionChecker and a couple asserts.
*
- * @param checkerReturnValue The value to have the VrCoreVersionChecker return
+ * @param checkerReturnCompatibility The compatibility to have the VrCoreVersionChecker return
*/
- private void infoBarTestHelper(int checkerReturnValue) throws InterruptedException {
+ private void infoBarTestHelper(int checkerReturnCompatibility) throws InterruptedException {
MockVrCoreVersionCheckerImpl mockChecker = new MockVrCoreVersionCheckerImpl();
- mockChecker.setMockReturnValue(checkerReturnValue);
+ mockChecker.setMockReturnValue(new VrCoreInfo(null, checkerReturnCompatibility));
VrUtils.getVrShellDelegateInstance().overrideVrCoreVersionCheckerForTesting(mockChecker);
mVrTestRule.loadUrlAndAwaitInitialization(
VrTestRule.getHtmlTestFile("generic_webvr_page"), PAGE_LOAD_TIMEOUT_S);
String displayFound = "VRDisplay Found";
String barPresent = "InfoBar present";
- if (checkerReturnValue == VrCoreVersionChecker.VR_READY) {
+ if (checkerReturnCompatibility == VrCoreCompatibility.VR_READY) {
Assert.assertTrue(
displayFound, mVrTestRule.vrDisplayFound(mVrTestRule.getFirstTabWebContents()));
Assert.assertFalse(barPresent,
VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView()));
- } else if (checkerReturnValue == VrCoreVersionChecker.VR_OUT_OF_DATE
- || checkerReturnValue == VrCoreVersionChecker.VR_NOT_AVAILABLE) {
+ } else if (checkerReturnCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE
+ || checkerReturnCompatibility == VrCoreCompatibility.VR_NOT_AVAILABLE) {
// Out of date and missing cases are the same, but with different text
String expectedMessage, expectedButton;
- if (checkerReturnValue == VrCoreVersionChecker.VR_OUT_OF_DATE) {
+ if (checkerReturnCompatibility == VrCoreCompatibility.VR_OUT_OF_DATE) {
expectedMessage = mVrTestRule.getActivity().getString(
R.string.vr_services_check_infobar_update_text);
expectedButton = mVrTestRule.getActivity().getString(
@@ -220,16 +220,17 @@ public class WebVrTest {
tempView = (TextView) mVrTestRule.getActivity().getWindow().getDecorView().findViewById(
R.id.button_primary);
Assert.assertEquals(expectedButton, tempView.getText().toString());
- } else if (checkerReturnValue == VrCoreVersionChecker.VR_NOT_SUPPORTED) {
+ } else if (checkerReturnCompatibility == VrCoreCompatibility.VR_NOT_SUPPORTED) {
Assert.assertFalse(
displayFound, mVrTestRule.vrDisplayFound(mVrTestRule.getFirstTabWebContents()));
Assert.assertFalse(barPresent,
VrUtils.isInfoBarPresent(mVrTestRule.getActivity().getWindow().getDecorView()));
} else {
- Assert.fail(
- "Invalid VrCoreVersionChecker value: " + String.valueOf(checkerReturnValue));
+ Assert.fail("Invalid VrCoreVersionChecker compatibility: "
+ + String.valueOf(checkerReturnCompatibility));
}
- Assert.assertEquals(checkerReturnValue, mockChecker.getLastReturnValue());
+ Assert.assertEquals(
+ checkerReturnCompatibility, mockChecker.getLastReturnValue().compatibility);
}
/**
@@ -239,7 +240,7 @@ public class WebVrTest {
@Test
@MediumTest
public void testInfoBarNotPresentWhenVrServicesCurrent() throws InterruptedException {
- infoBarTestHelper(VrCoreVersionChecker.VR_READY);
+ infoBarTestHelper(VrCoreCompatibility.VR_READY);
}
/**
@@ -248,7 +249,7 @@ public class WebVrTest {
@Test
@MediumTest
public void testInfoBarPresentWhenVrServicesOutdated() throws InterruptedException {
- infoBarTestHelper(VrCoreVersionChecker.VR_OUT_OF_DATE);
+ infoBarTestHelper(VrCoreCompatibility.VR_OUT_OF_DATE);
}
/**
@@ -257,7 +258,7 @@ public class WebVrTest {
@Test
@MediumTest
public void testInfoBarPresentWhenVrServicesMissing() throws InterruptedException {
- infoBarTestHelper(VrCoreVersionChecker.VR_NOT_AVAILABLE);
+ infoBarTestHelper(VrCoreCompatibility.VR_NOT_AVAILABLE);
}
/**
@@ -267,7 +268,7 @@ public class WebVrTest {
@Test
@MediumTest
public void testInfoBarNotPresentWhenVrServicesNotSupported() throws InterruptedException {
- infoBarTestHelper(VrCoreVersionChecker.VR_NOT_SUPPORTED);
+ infoBarTestHelper(VrCoreCompatibility.VR_NOT_SUPPORTED);
}
/**

Powered by Google App Engine
This is Rietveld 408576698