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

Unified Diff: chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config_unittest.cc

Issue 2701313002: Adds a modal dialog implementation of the settings reset prompt. (Closed)
Patch Set: Fix constness in mock test class Created 3 years, 10 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/safe_browsing/settings_reset_prompt/settings_reset_prompt_config_unittest.cc
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config_unittest.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config_unittest.cc
index 4b27e8ce68e9520b3029b015f68e16bb35e70c22..90be575942c2e7cb2e048b6cafc61f72726352a3 100644
--- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config_unittest.cc
+++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config_unittest.cc
@@ -22,6 +22,10 @@ const char kTrialName[] = "trial";
const char kDomainHash[] =
"0a79eaf6adb7b1e60d3fa548aa63105f525a00448efbb59ee965b9351a90ac31";
+bool IsPromptEnabled() {
+ return base::FeatureList::IsEnabled(kSettingsResetPrompt);
+}
+
// Test class that initializes a ScopedFeatureList so that all tests
// start off with all features disabled.
class SettingsResetPromptConfigTest : public ::testing::Test {
@@ -49,15 +53,8 @@ class SettingsResetPromptConfigTest : public ::testing::Test {
base::test::ScopedFeatureList scoped_feature_list_;
};
-TEST_F(SettingsResetPromptConfigTest, IsPromptEnabled) {
- EXPECT_FALSE(SettingsResetPromptConfig::IsPromptEnabled());
-
- SetFeatureParams(GetDefaultFeatureParams());
- EXPECT_TRUE(SettingsResetPromptConfig::IsPromptEnabled());
-}
-
TEST_F(SettingsResetPromptConfigTest, Create) {
- ASSERT_FALSE(SettingsResetPromptConfig::IsPromptEnabled());
+ ASSERT_FALSE(IsPromptEnabled());
// |Create()| should return nullptr when feature is not enabled.
EXPECT_FALSE(SettingsResetPromptConfig::Create());
@@ -65,7 +62,7 @@ TEST_F(SettingsResetPromptConfigTest, Create) {
// |Create()| should return false when feature is enabled, but parameters are
// |missing.
scoped_feature_list_.InitAndEnableFeature(kSettingsResetPrompt);
- ASSERT_TRUE(SettingsResetPromptConfig::IsPromptEnabled());
+ ASSERT_TRUE(IsPromptEnabled());
EXPECT_FALSE(SettingsResetPromptConfig::Create());
SetFeatureParams(Parameters());
EXPECT_FALSE(SettingsResetPromptConfig::Create());

Powered by Google App Engine
This is Rietveld 408576698