Chromium Code Reviews| Index: chrome/browser/permissions/permission_uma_util.cc |
| diff --git a/chrome/browser/permissions/permission_uma_util.cc b/chrome/browser/permissions/permission_uma_util.cc |
| index da9e4f1471ddf000dbf74c01c44ad6460328c238..9ddfcf5a3393199dfb44a1293ce75b8b9a1eee25 100644 |
| --- a/chrome/browser/permissions/permission_uma_util.cc |
| +++ b/chrome/browser/permissions/permission_uma_util.cc |
| @@ -60,6 +60,8 @@ using content::PermissionType; |
| namespace { |
| +static bool gIsFakeOfficialBuildForTest = false; |
| + |
| const std::string GetRapporMetric(ContentSettingsType permission, |
| PermissionAction action) { |
| std::string action_str; |
| @@ -577,12 +579,24 @@ void PermissionUmaUtil::PermissionPromptDeniedWithPersistenceToggle( |
| } |
| } |
| +void PermissionUmaUtil::FakeOfficialBuildForTest() { |
| + gIsFakeOfficialBuildForTest = true; |
| +} |
| + |
| bool PermissionUmaUtil::IsOptedIntoPermissionActionReporting(Profile* profile) { |
| if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kDisablePermissionActionReporting)) { |
| return false; |
| } |
| + bool official_build = gIsFakeOfficialBuildForTest; |
|
Nathan Parker
2017/05/25 00:13:13
Do these tests need to run on non-official test bu
benwells
2017/05/25 01:17:41
I believe all the CQ and try bots are non-official
benwells
2017/05/25 06:46:00
OK - science done. Looks like no try bots run that
|
| +#if defined(OFFICIAL_BUILD) && defined(GOOGLE_CHROME_BUILD) |
| + official_build = true; |
| +#endif |
| + |
| + if (!official_build) |
| + return false; |
| + |
| DCHECK(profile); |
| if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE) |
| return false; |