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

Unified Diff: chrome/browser/permissions/permission_uma_util_unittest.cc

Issue 2269863002: Turn on Permission Action Reporting by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/browser/permissions/permission_uma_util_unittest.cc
diff --git a/chrome/browser/permissions/permission_uma_util_unittest.cc b/chrome/browser/permissions/permission_uma_util_unittest.cc
index cf13ccb10980d6d29914a6af574a8ca1bc464e84..ab697d8677e8e29fbaa1c6e714a896778ec0b8b9 100644
--- a/chrome/browser/permissions/permission_uma_util_unittest.cc
+++ b/chrome/browser/permissions/permission_uma_util_unittest.cc
@@ -91,10 +91,7 @@ class PermissionUmaUtilTest : public testing::Test {
// true if Safe Browsing is enabled, Permission Action Reporting flag is
// enabled, not in incognito mode and signed in with default sync preferences.
TEST_F(PermissionUmaUtilTest, IsOptedIntoPermissionActionReportingSignInCheck) {
- base::test::ScopedCommandLine scoped_command_line;
SetSafeBrowsing(true);
- scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
EXPECT_FALSE(IsOptedIntoPermissionActionReporting(profile()));
FakeSignIn();
@@ -112,28 +109,26 @@ TEST_F(PermissionUmaUtilTest, IsOptedIntoPermissionActionReportingFlagCheck) {
SetSafeBrowsing(true);
FakeSignIn();
SetMockSyncService();
+ EXPECT_TRUE(IsOptedIntoPermissionActionReporting(profile()));
{
base::test::ScopedCommandLine scoped_command_line;
scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
- EXPECT_TRUE(IsOptedIntoPermissionActionReporting(profile()));
+ switches::kDisablePermissionActionReporting);
+ EXPECT_FALSE(IsOptedIntoPermissionActionReporting(profile()));
} // Reset the command line.
- EXPECT_FALSE(IsOptedIntoPermissionActionReporting(profile()));
+ EXPECT_TRUE(IsOptedIntoPermissionActionReporting(profile()));
base::test::ScopedCommandLine scoped_command_line;
scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kDisablePermissionActionReporting);
- EXPECT_FALSE(IsOptedIntoPermissionActionReporting(profile()));
+ switches::kEnablePermissionActionReporting);
+ EXPECT_TRUE(IsOptedIntoPermissionActionReporting(profile()));
}
// Test that PermissionUmaUtil::IsOptedIntoPermissionActionReporting returns
// false if Safe Browsing is disabled.
TEST_F(PermissionUmaUtilTest,
IsOptedIntoPermissionActionReportingSafeBrowsingCheck) {
- base::test::ScopedCommandLine scoped_command_line;
- scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
FakeSignIn();
SetMockSyncService();
SetSafeBrowsing(true);
@@ -147,9 +142,6 @@ TEST_F(PermissionUmaUtilTest,
// false if Sync is disabled.
TEST_F(PermissionUmaUtilTest,
IsOptedIntoPermissionActionReportingProfileSyncServiceCheck) {
- base::test::ScopedCommandLine scoped_command_line;
- scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
SetSafeBrowsing(true);
FakeSignIn();
ProfileSyncServiceMock* mock_sync_service = SetMockSyncService();
@@ -164,9 +156,6 @@ TEST_F(PermissionUmaUtilTest,
// false if Tab Sync and Pref Sync are not both enabled.
TEST_F(PermissionUmaUtilTest,
IsOptedIntoPermissionActionReportingSyncPreferenceCheck) {
- base::test::ScopedCommandLine scoped_command_line;
- scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
SetSafeBrowsing(true);
FakeSignIn();
ProfileSyncServiceMock* mock_sync_service = SetMockSyncService();
@@ -198,9 +187,6 @@ TEST_F(PermissionUmaUtilTest,
// false if Sync is not active.
TEST_F(PermissionUmaUtilTest,
IsOptedIntoPermissionActionReportingProfileSyncServiceActiveCheck) {
- base::test::ScopedCommandLine scoped_command_line;
- scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
SetSafeBrowsing(true);
FakeSignIn();
ProfileSyncServiceMock* mock_sync_service = SetMockSyncService();
@@ -215,9 +201,6 @@ TEST_F(PermissionUmaUtilTest,
// false if a custom Sync passphrase is set.
TEST_F(PermissionUmaUtilTest,
IsOptedIntoPermissionActionReportingSyncPassphraseCheck) {
- base::test::ScopedCommandLine scoped_command_line;
- scoped_command_line.GetProcessCommandLine()->AppendSwitch(
- switches::kEnablePermissionActionReporting);
SetSafeBrowsing(true);
FakeSignIn();
ProfileSyncServiceMock* mock_sync_service = SetMockSyncService();
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/safe_browsing/permission_reporter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698