Commit f0935f0e authored by Daniel Park's avatar Daniel Park Committed by Commit Bot

[Chrome Home Survey] Force UMA Enabled For Survey

Adds sForceUmaEnabledForTesting to bypass
 UMA enabled check for testing purposes.

Bug: 771446
Change-Id: I755495a567963b7d18669d988e28203b36f7a678
Reviewed-on: https://chromium-review.googlesource.com/801233
Commit-Queue: Daniel Park <danielpark@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520784}
parent 5ed06e7d
...@@ -50,6 +50,8 @@ public class ChromeHomeSurveyController implements InfoBarContainer.InfoBarAnima ...@@ -50,6 +50,8 @@ public class ChromeHomeSurveyController implements InfoBarContainer.InfoBarAnima
private static final String TRIAL_NAME = "ChromeHome"; private static final String TRIAL_NAME = "ChromeHome";
private static final String MAX_NUMBER = "MaxNumber"; private static final String MAX_NUMBER = "MaxNumber";
private static boolean sForceUmaEnabledForTesting;
static final long ONE_WEEK_IN_MILLIS = 604800000L; static final long ONE_WEEK_IN_MILLIS = 604800000L;
static final String DATE_LAST_ROLLED_KEY = "chrome_home_date_last_rolled_for_survey"; static final String DATE_LAST_ROLLED_KEY = "chrome_home_date_last_rolled_for_survey";
...@@ -109,7 +111,7 @@ public class ChromeHomeSurveyController implements InfoBarContainer.InfoBarAnima ...@@ -109,7 +111,7 @@ public class ChromeHomeSurveyController implements InfoBarContainer.InfoBarAnima
/** @return Whether the user qualifies for the survey. */ /** @return Whether the user qualifies for the survey. */
private boolean doesUserQualifyForSurvey() { private boolean doesUserQualifyForSurvey() {
if (DeviceFormFactor.isTablet()) return false; if (DeviceFormFactor.isTablet()) return false;
if (!isUMAEnabled()) return false; if (!isUMAEnabled() && !sForceUmaEnabledForTesting) return false;
if (AccessibilityUtil.isAccessibilityEnabled()) return false; if (AccessibilityUtil.isAccessibilityEnabled()) return false;
if (hasInfoBarBeenDisplayed()) return false; if (hasInfoBarBeenDisplayed()) return false;
if (!FeatureUtilities.isChromeHomeEnabled()) return true; if (!FeatureUtilities.isChromeHomeEnabled()) return true;
...@@ -396,4 +398,10 @@ public class ChromeHomeSurveyController implements InfoBarContainer.InfoBarAnima ...@@ -396,4 +398,10 @@ public class ChromeHomeSurveyController implements InfoBarContainer.InfoBarAnima
if (result) mController.startDownload(mContext, mSelector); if (result) mController.startDownload(mContext, mSelector);
} }
} }
// Force enable UMA testing for testing.
@VisibleForTesting
public static void forceIsUMAEnabledForTesting(boolean forcedUMAStatus) {
sForceUmaEnabledForTesting = forcedUMAStatus;
}
} }
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