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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/MockVrCoreVersionCheckerImpl.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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.vr_shell; 5 package org.chromium.chrome.browser.vr_shell;
6 6
7 /** 7 /**
8 * Mock version of VrCoreVersionCheckerImpl that allows setting of the return 8 * Mock version of VrCoreVersionCheckerImpl that allows setting of the return
9 * value. 9 * value.
10 */ 10 */
11 public class MockVrCoreVersionCheckerImpl extends VrCoreVersionCheckerImpl { 11 public class MockVrCoreVersionCheckerImpl extends VrCoreVersionCheckerImpl {
12 private boolean mUseActualImplementation; 12 private boolean mUseActualImplementation;
13 private int mMockReturnValue = VrCoreVersionChecker.VR_READY; 13 private VrCoreInfo mMockReturnValue = new VrCoreInfo(null, VrCoreCompatibili ty.VR_READY);
14 private int mLastReturnValue = -1; 14 private VrCoreInfo mLastReturnValue = null;
15 15
16 @Override 16 @Override
17 public int getVrCoreCompatibility() { 17 public VrCoreInfo getVrCoreInfo() {
18 mLastReturnValue = 18 mLastReturnValue = mUseActualImplementation ? super.getVrCoreInfo() : mM ockReturnValue;
19 mUseActualImplementation ? super.getVrCoreCompatibility() : mMoc kReturnValue;
20 return mLastReturnValue; 19 return mLastReturnValue;
21 } 20 }
22 21
23 public int getLastReturnValue() { 22 public VrCoreInfo getLastReturnValue() {
24 return mLastReturnValue; 23 return mLastReturnValue;
25 } 24 }
26 25
27 public void setMockReturnValue(int value) { 26 public void setMockReturnValue(VrCoreInfo value) {
28 mMockReturnValue = value; 27 mMockReturnValue = value;
29 } 28 }
30 29
31 public void setUseActualImplementation(boolean useActual) { 30 public void setUseActualImplementation(boolean useActual) {
32 mUseActualImplementation = useActual; 31 mUseActualImplementation = useActual;
33 } 32 }
34 } 33 }
OLDNEW
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698