Commit 17cf7957 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Avoid late keyed services with TestingProfile

This patch migrates tests away from deprecated APIs and adopts
TestingProfile::Builder for tests in
/chrome/browser/search_engines.

Rationale: creating or overriding keyed services after the profile has
been created is problematic and known to cause hard-to-debug test
flakiness, because it bypasses BrowserContextDependencyManager and often
leading to use-after-free.

This CL was uploaded by git cl split.

R=orinj@chromium.org

Bug: 1106699
Change-Id: I40bb5c4a6624623f2548babc4ef8fed32566b9b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316362
Auto-Submit: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarOrin Jaworski <orinj@chromium.org>
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791547}
parent cc35843b
...@@ -1224,7 +1224,6 @@ TEST_F(TemplateURLServiceWithoutFallbackTest, ManualCountrySpecificGoogleURL) { ...@@ -1224,7 +1224,6 @@ TEST_F(TemplateURLServiceWithoutFallbackTest, ManualCountrySpecificGoogleURL) {
// Make sure TemplateURLService generates a KEYWORD_GENERATED visit for // Make sure TemplateURLService generates a KEYWORD_GENERATED visit for
// KEYWORD visits. // KEYWORD visits.
TEST_F(TemplateURLServiceTest, GenerateVisitOnKeyword) { TEST_F(TemplateURLServiceTest, GenerateVisitOnKeyword) {
test_util()->profile()->CreateBookmarkModel(false);
ASSERT_TRUE(test_util()->profile()->CreateHistoryService(true, false)); ASSERT_TRUE(test_util()->profile()->CreateHistoryService(true, false));
test_util()->ResetModel(true); test_util()->ResetModel(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment