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

Unified Diff: chrome/browser/ui/views/settings_reset_prompt_dialog_browsertest.cc

Issue 2918053003: Settings reset prompt: Fetch default settings only when needed. (Closed)
Patch Set: Addressed Chris's comment Created 3 years, 7 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
« no previous file with comments | « chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/settings_reset_prompt_dialog_browsertest.cc
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog_browsertest.cc b/chrome/browser/ui/views/settings_reset_prompt_dialog_browsertest.cc
index efa57bd4beaff4035a0b0710be27c9da4a531d92..1a7f73f88a5583573c056b6d791318fe1515753a 100644
--- a/chrome/browser/ui/views/settings_reset_prompt_dialog_browsertest.cc
+++ b/chrome/browser/ui/views/settings_reset_prompt_dialog_browsertest.cc
@@ -68,8 +68,6 @@ class MockSettingsResetPromptModel
: SettingsResetPromptModel(
profile,
base::MakeUnique<NiceMock<MockSettingsResetPromptConfig>>(),
- base::MakeUnique<ResettableSettingsSnapshot>(profile),
- base::MakeUnique<BrandcodedDefaultSettings>(),
base::MakeUnique<NiceMock<MockProfileResetter>>(profile)) {
EXPECT_LE(params.startup_pages, arraysize(kStartupUrls));
@@ -91,7 +89,7 @@ class MockSettingsResetPromptModel
}
ON_CALL(*this, ShouldPromptForReset()).WillByDefault(Return(true));
- ON_CALL(*this, PerformReset(_)).WillByDefault(Return());
+ ON_CALL(*this, MockPerformReset(_, _)).WillByDefault(Return());
ON_CALL(*this, DialogShown()).WillByDefault(Return());
ON_CALL(*this, homepage()).WillByDefault(Return(GURL(kHomepageUrl)));
@@ -122,7 +120,12 @@ class MockSettingsResetPromptModel
}
~MockSettingsResetPromptModel() override {}
- MOCK_METHOD1(PerformReset, void(const base::Closure&));
+ void PerformReset(std::unique_ptr<BrandcodedDefaultSettings> default_settings,
+ const base::Closure& callback) override {
+ MockPerformReset(default_settings.get(), callback);
+ }
+ MOCK_METHOD2(MockPerformReset,
+ void(BrandcodedDefaultSettings*, const base::Closure&));
MOCK_CONST_METHOD0(ShouldPromptForReset, bool());
MOCK_METHOD0(DialogShown, void());
MOCK_CONST_METHOD0(homepage, GURL());
@@ -166,7 +169,8 @@ class SettingsResetPromptDialogTest : public DialogBrowserTest {
safe_browsing::SettingsResetPromptController::ShowSettingsResetPrompt(
browser(),
- new safe_browsing::SettingsResetPromptController(std::move(model)));
+ new safe_browsing::SettingsResetPromptController(
+ std::move(model), base::MakeUnique<BrandcodedDefaultSettings>()));
}
};
« no previous file with comments | « chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698