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

Unified Diff: ash/test/ash_test_helper.cc

Issue 2772513003: Makes AshTestHelper shutdown ChromeOS NetworkHandler (Closed)
Patch Set: 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..3f0c42723ba4399612c44e489c4d230ccea194a6 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"
@@ -300,12 +301,21 @@ void AshTestHelper::CreateMashWindowManager() {
window_tree_client_setup_.OwnWindowTreeClient(),
ash_test_environment_->GetBlockingPool());
+ // WindowManagerApplication starts the NetworkHandler. The NetworkHandler may
+ // cause subtle side effects (such as additional tray items) and tests expect
+ // it not to be running, so shut it down.
+ chromeos::NetworkHandler::Shutdown();
James Cook 2017/03/22 22:27:22 Rather than doing this, how about passing a "for_t
+
aura::WindowTreeClient* window_tree_client =
window_manager_app_->window_manager()->window_tree_client();
window_tree_client_private_ =
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