Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: ash/test/ash_test_helper.cc

Issue 2772513003: Makes AshTestHelper shutdown ChromeOS NetworkHandler (Closed)
Patch Set: comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_helper.cc
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index 3bb992532e8b1eaac858758205ec15cdaf2f19c3..89bfe721124b07cb80d33db616333358cb0511a4 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -27,6 +27,7 @@
#include "base/test/sequenced_worker_pool_owner.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/network/network_handler.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "ui/aura/env.h"
@@ -296,9 +297,13 @@ void AshTestHelper::CreateMashWindowManager() {
window_manager_app_->window_manager_.get());
aura::test::EnvTestHelper().SetWindowTreeClient(
window_tree_client_setup_.window_tree_client());
+ // Classic ash does not start the NetworkHandler in tests, so don't start it
+ // for mash either. The NetworkHandler may cause subtle side effects (such as
+ // additional tray items) that can make for flaky tests.
+ const bool init_network_handler = false;
window_manager_app_->InitWindowManager(
window_tree_client_setup_.OwnWindowTreeClient(),
- ash_test_environment_->GetBlockingPool());
+ ash_test_environment_->GetBlockingPool(), init_network_handler);
aura::WindowTreeClient* window_tree_client =
window_manager_app_->window_manager()->window_tree_client();
@@ -306,6 +311,10 @@ void AshTestHelper::CreateMashWindowManager() {
base::MakeUnique<aura::WindowTreeClientPrivate>(window_tree_client);
int next_x = 0;
CreateRootWindowController("800x600", &next_x);
+
+ // Make sure the NetworkHandler didn't get turned on, see above comment as to
+ // why the NetworkHandler should not be running.
+ CHECK(!chromeos::NetworkHandler::IsInitialized());
}
void AshTestHelper::CreateShell() {
« no previous file with comments | « ash/shelf/shelf_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698