Commit 242098c2 authored by Michael Giuffrida's avatar Michael Giuffrida Committed by Commit Bot

ShellExtensionLoaderTest should use existing PrefService

ShellExtensionLoaderTest associates a new TestingPrefServiceSimple with
the BrowserContext, but instead should associate the existing
PrefService created by ExtensionsTest.

Creating its own TestingPrefServiceSimple, besides being unnecessary,
leads to invalid casts of its PrefRegistrySimple to a
PrefRegistrySyncable (breaking the Linux CFI bots).

TBR=rdevlin.cronin@chromium.org

Bug: 820647
Change-Id: I2ae62a396622d034c8c5b04bbe9dabb529b5bd25
Reviewed-on: https://chromium-review.googlesource.com/957871Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542302}
parent cbbf6d7b
......@@ -12,7 +12,6 @@
#include "base/path_service.h"
#include "components/crx_file/id_util.h"
#include "components/keep_alive_registry/keep_alive_registry.h"
#include "components/prefs/testing_pref_service.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_context.h"
#include "content/public/test/test_utils.h"
......@@ -95,7 +94,9 @@ class ShellExtensionLoaderTest : public ExtensionsTest {
ExtensionsTest::SetUp();
extensions_browser_client()->set_extension_system_factory(&factory_);
user_prefs::UserPrefs::Set(browser_context(), &testing_pref_service_);
// ExtensionsTest sets up the ExtensionPrefs, but we still need to attach
// the PrefService to the browser context.
user_prefs::UserPrefs::Set(browser_context(), pref_service());
event_router_ = CreateAndUseTestEventRouter(browser_context());
}
......@@ -135,7 +136,6 @@ class ShellExtensionLoaderTest : public ExtensionsTest {
private:
MockExtensionSystemFactory<TestExtensionSystem> factory_;
TestingPrefServiceSimple testing_pref_service_;
TestEventRouter* event_router_ = nullptr; // Created in SetUp().
......
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