athena: Avoid initializaing chromeos::Network for tests.

Initializaing chromeos::Network triggers a whole bunch of things that are
not necessary or useful in tests. So avoid initializing this subsystem, since
none of the tests depend on it. Tests that do depend on this in the future
should explicitly initialize this from SetUp().

This change brings down the runtime of athena_unittests significantly.

BUG=412535
R=oshima@chromium.org

Review URL: https://codereview.chromium.org/653853004

Cr-Commit-Position: refs/heads/master@{#300491}
parent 8103e2c7
...@@ -224,7 +224,8 @@ StatusIconContainerView::StatusIconContainerView( ...@@ -224,7 +224,8 @@ StatusIconContainerView::StatusIconContainerView(
AddChildView(CreateLabel(color_scheme, "Network:")); AddChildView(CreateLabel(color_scheme, "Network:"));
views::Label* network_label = CreateLabel(color_scheme, std::string()); views::Label* network_label = CreateLabel(color_scheme, std::string());
AddChildView(network_label); AddChildView(network_label);
network_status_.reset(new NetworkStatus(network_label)); if (chromeos::NetworkHandler::IsInitialized())
network_status_.reset(new NetworkStatus(network_label));
views::ImageView* battery_view = new views::ImageView(); views::ImageView* battery_view = new views::ImageView();
AddChildView(battery_view); AddChildView(battery_view);
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/network/network_handler.h"
#include "ui/aura/env.h" #include "ui/aura/env.h"
#include "ui/aura/input_state_lookup.h" #include "ui/aura/input_state_lookup.h"
#include "ui/aura/test/env_test_helper.h" #include "ui/aura/test/env_test_helper.h"
...@@ -52,7 +51,6 @@ void AthenaTestHelper::SetUp(ui::ContextFactory* context_factory) { ...@@ -52,7 +51,6 @@ void AthenaTestHelper::SetUp(ui::ContextFactory* context_factory) {
file_thread_->StartWithOptions(options); file_thread_->StartWithOptions(options);
chromeos::DBusThreadManager::Initialize(); chromeos::DBusThreadManager::Initialize();
chromeos::NetworkHandler::Initialize();
ui::InitializeInputMethodForTesting(); ui::InitializeInputMethodForTesting();
aura::Env::CreateInstance(true); aura::Env::CreateInstance(true);
aura::Env::GetInstance()->set_context_factory(context_factory); aura::Env::GetInstance()->set_context_factory(context_factory);
...@@ -81,7 +79,6 @@ void AthenaTestHelper::TearDown() { ...@@ -81,7 +79,6 @@ void AthenaTestHelper::TearDown() {
#endif #endif
ui::ShutdownInputMethodForTesting(); ui::ShutdownInputMethodForTesting();
chromeos::NetworkHandler::Shutdown();
chromeos::DBusThreadManager::Shutdown(); chromeos::DBusThreadManager::Shutdown();
} }
......
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