Commit 82cbc419 authored by mek's avatar mek Committed by Commit bot

Get rid of ExtensionServiceTestBase::ResetThreadBundle

The method is fundamentally flawed (it invalidates the TaskRunners for
anything that might have already be initialized), and also isn't
actually used other than in one particular test that doesn't seem to
need what it does anyway.

BUG=None

Review-Url: https://codereview.chromium.org/2863023002
Cr-Commit-Position: refs/heads/master@{#469563}
parent bfbe9c78
...@@ -210,7 +210,6 @@ class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase { ...@@ -210,7 +210,6 @@ class ExtensionInfoGeneratorUnitTest : public ExtensionServiceTestBase {
// Test some of the basic fields. // Test some of the basic fields.
TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) { TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) {
// Enable error console for testing. // Enable error console for testing.
ResetThreadBundle(content::TestBrowserThreadBundle::DEFAULT);
FeatureSwitch::ScopedOverride error_console_override( FeatureSwitch::ScopedOverride error_console_override(
FeatureSwitch::error_console(), true); FeatureSwitch::error_console(), true);
profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true);
......
...@@ -83,7 +83,6 @@ ExtensionServiceTestBase::ExtensionServiceTestBase() ...@@ -83,7 +83,6 @@ ExtensionServiceTestBase::ExtensionServiceTestBase()
: thread_bundle_(new content::TestBrowserThreadBundle(kThreadOptions)), : thread_bundle_(new content::TestBrowserThreadBundle(kThreadOptions)),
service_(NULL), service_(NULL),
testing_local_state_(TestingBrowserProcess::GetGlobal()), testing_local_state_(TestingBrowserProcess::GetGlobal()),
did_reset_thread_bundle_(false),
registry_(NULL) { registry_(NULL) {
base::FilePath test_data_dir; base::FilePath test_data_dir;
if (!PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)) { if (!PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)) {
...@@ -94,11 +93,6 @@ ExtensionServiceTestBase::ExtensionServiceTestBase() ...@@ -94,11 +93,6 @@ ExtensionServiceTestBase::ExtensionServiceTestBase()
} }
ExtensionServiceTestBase::~ExtensionServiceTestBase() { ExtensionServiceTestBase::~ExtensionServiceTestBase() {
// Parts of destruction have to happen on an IO thread, so if the thread
// bundle is reset, we need to change it back.
if (did_reset_thread_bundle_)
ResetThreadBundle(kThreadOptions);
// Why? Because |profile_| has to be destroyed before |at_exit_manager_|, but // Why? Because |profile_| has to be destroyed before |at_exit_manager_|, but
// is declared above it in the class definition since it's protected. // is declared above it in the class definition since it's protected.
profile_.reset(); profile_.reset();
...@@ -194,12 +188,6 @@ void ExtensionServiceTestBase:: ...@@ -194,12 +188,6 @@ void ExtensionServiceTestBase::
InitializeExtensionService(params); InitializeExtensionService(params);
} }
void ExtensionServiceTestBase::ResetThreadBundle(int options) {
did_reset_thread_bundle_ = true;
thread_bundle_.reset();
thread_bundle_.reset(new content::TestBrowserThreadBundle(options));
}
size_t ExtensionServiceTestBase::GetPrefKeyCount() { size_t ExtensionServiceTestBase::GetPrefKeyCount() {
const base::DictionaryValue* dict = const base::DictionaryValue* dict =
profile()->GetPrefs()->GetDictionary("extensions.settings"); profile()->GetPrefs()->GetDictionary("extensions.settings");
......
...@@ -102,9 +102,6 @@ class ExtensionServiceTestBase : public testing::Test { ...@@ -102,9 +102,6 @@ class ExtensionServiceTestBase : public testing::Test {
// Initializes an ExtensionService without extensions enabled. // Initializes an ExtensionService without extensions enabled.
void InitializeExtensionServiceWithExtensionsDisabled(); void InitializeExtensionServiceWithExtensionsDisabled();
// Resets the browser thread bundle to one with |options|.
void ResetThreadBundle(int options);
// Helpers to check the existence and values of extension prefs. // Helpers to check the existence and values of extension prefs.
size_t GetPrefKeyCount(); size_t GetPrefKeyCount();
void ValidatePrefKeyCount(size_t count); void ValidatePrefKeyCount(size_t count);
...@@ -164,9 +161,6 @@ class ExtensionServiceTestBase : public testing::Test { ...@@ -164,9 +161,6 @@ class ExtensionServiceTestBase : public testing::Test {
private: private:
void CreateExtensionService(const ExtensionServiceInitParams& params); void CreateExtensionService(const ExtensionServiceInitParams& params);
// Whether or not the thread bundle was reset in the test.
bool did_reset_thread_bundle_;
// The directory into which extensions are installed. // The directory into which extensions are installed.
base::FilePath extensions_install_dir_; base::FilePath extensions_install_dir_;
......
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