OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/test/scoped_feature_list.h" | 11 #include "base/test/scoped_feature_list.h" |
12 #include "components/prefs/pref_registry_simple.h" | 12 #include "components/prefs/pref_registry_simple.h" |
13 #include "components/prefs/testing_pref_service.h" | 13 #include "components/prefs/testing_pref_service.h" |
14 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 14 #include "components/safe_browsing/common/safe_browsing_prefs.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace safe_browsing { | 17 namespace safe_browsing { |
18 | 18 |
19 class SafeBrowsingPrefsTest : public ::testing::Test { | 19 class SafeBrowsingPrefsTest : public ::testing::Test { |
20 protected: | 20 protected: |
21 void SetUp() override { | 21 void SetUp() override { |
22 prefs_.registry()->RegisterBooleanPref( | 22 prefs_.registry()->RegisterBooleanPref( |
23 prefs::kSafeBrowsingExtendedReportingEnabled, false); | 23 prefs::kSafeBrowsingExtendedReportingEnabled, false); |
24 prefs_.registry()->RegisterBooleanPref( | 24 prefs_.registry()->RegisterBooleanPref( |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 EXPECT_EQ(SBER_LEVEL_OFF, GetExtendedReportingLevel(prefs_)); | 453 EXPECT_EQ(SBER_LEVEL_OFF, GetExtendedReportingLevel(prefs_)); |
454 // Turning on Scout gives us Scout level reporting | 454 // Turning on Scout gives us Scout level reporting |
455 ResetPrefs(/*sber=*/false, /*scout_reporting=*/true, /*scout_group=*/true); | 455 ResetPrefs(/*sber=*/false, /*scout_reporting=*/true, /*scout_group=*/true); |
456 EXPECT_EQ(SBER_LEVEL_SCOUT, GetExtendedReportingLevel(prefs_)); | 456 EXPECT_EQ(SBER_LEVEL_SCOUT, GetExtendedReportingLevel(prefs_)); |
457 // .. and the legacy pref doesn't affect this. | 457 // .. and the legacy pref doesn't affect this. |
458 ResetPrefs(/*sber=*/true, /*scout_reporting=*/true, /*scout_group=*/true); | 458 ResetPrefs(/*sber=*/true, /*scout_reporting=*/true, /*scout_group=*/true); |
459 EXPECT_EQ(SBER_LEVEL_SCOUT, GetExtendedReportingLevel(prefs_)); | 459 EXPECT_EQ(SBER_LEVEL_SCOUT, GetExtendedReportingLevel(prefs_)); |
460 } | 460 } |
461 | 461 |
462 } // namespace safe_browsing | 462 } // namespace safe_browsing |
OLD | NEW |