| Index: components/browser_context_keyed_service/browser_context_dependency_manager.cc
|
| diff --git a/components/browser_context_keyed_service/browser_context_dependency_manager.cc b/components/browser_context_keyed_service/browser_context_dependency_manager.cc
|
| index 1031f4e831026d376c47f35bac56e52cd304d636..4b4fc682502722a567732e53291063b265e04d9a 100644
|
| --- a/components/browser_context_keyed_service/browser_context_dependency_manager.cc
|
| +++ b/components/browser_context_keyed_service/browser_context_dependency_manager.cc
|
| @@ -64,9 +64,11 @@ void BrowserContextDependencyManager::CreateBrowserContextServices(
|
| BrowserContextKeyedBaseFactory* factory =
|
| static_cast<BrowserContextKeyedBaseFactory*>(construction_order[i]);
|
|
|
| - if (!context->IsOffTheRecord()) {
|
| + if (is_testing_context || !context->IsOffTheRecord()) {
|
| // We only register preferences on normal contexts because the incognito
|
| - // context shares the pref service with the normal one.
|
| + // context shares the pref service with the normal one. Always register
|
| + // for testing contexts, because they often are created standalone
|
| + // without an associated "normal" context.
|
| factory->RegisterUserPrefsOnBrowserContext(context);
|
| }
|
|
|
|
|