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

Unified Diff: ash/mus/window_manager_unittest.cc

Issue 2694623016: chromeos: Makes AshTestBase/Helper target mash when appropriate (Closed)
Patch Set: feedback Created 3 years, 10 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/mus/window_manager_application.h ('k') | ash/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager_unittest.cc
diff --git a/ash/mus/window_manager_unittest.cc b/ash/mus/window_manager_unittest.cc
index 4c2c0cd0e88246778ebfd775b94812bdbd1a1108..45fc419fc4d31dfcf5e6e3d3d8c68ddab9e8c94d 100644
--- a/ash/mus/window_manager_unittest.cc
+++ b/ash/mus/window_manager_unittest.cc
@@ -66,7 +66,29 @@ class WindowManagerTest : public service_manager::test::ServiceTest {
WindowManagerTest() : service_manager::test::ServiceTest("mash_unittests") {}
~WindowManagerTest() override {}
+ // service_manager::test::ServiceTest:
+ void SetUp() override {
+ service_manager::test::ServiceTest::SetUp();
+
+ // This test connects to the real mus. This results in
+ // aura::WindowTreeClient resetting the context_factory on Env. As all
+ // tests share the same Env (see mash_test_suite) we need to restore the
+ // context_factory when done.
+ aura::Env* env = aura::Env::GetInstance();
+ initial_context_factory_ = env->context_factory();
+ initial_context_factory_private_ = env->context_factory_private();
+ }
+
+ void TearDown() override {
+ aura::Env* env = aura::Env::GetInstance();
+ env->set_context_factory(initial_context_factory_);
+ env->set_context_factory_private(initial_context_factory_private_);
+ }
+
private:
+ ui::ContextFactory* initial_context_factory_ = nullptr;
+ ui::ContextFactoryPrivate* initial_context_factory_private_ = nullptr;
+
DISALLOW_COPY_AND_ASSIGN(WindowManagerTest);
};
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | ash/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698