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

Side by Side Diff: ui/aura/test/aura_mus_test_base.cc

Issue 2865443002: Install FakeContextFactory for AuraMusWmTestBase (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « ui/aura/test/aura_mus_test_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/test/aura_mus_test_base.h" 5 #include "ui/aura/test/aura_mus_test_base.h"
6 6
7 namespace aura { 7 namespace aura {
8 namespace test { 8 namespace test {
9 9
10 AuraMusWmTestBase::AuraMusWmTestBase() {} 10 AuraMusWmTestBase::AuraMusWmTestBase() {}
11 11
12 AuraMusWmTestBase::~AuraMusWmTestBase() {} 12 AuraMusWmTestBase::~AuraMusWmTestBase() {}
13 13
14 void AuraMusWmTestBase::SetUp() { 14 void AuraMusWmTestBase::SetUp() {
15 EnableMusWithTestWindowTree(); 15 EnableMusWithTestWindowTree();
16 AuraTestBase::SetUp(); 16 AuraTestBase::SetUp();
17
18 aura::Env* env = aura::Env::GetInstance();
19 DCHECK(env);
20 context_factory_to_restore_ = env->context_factory();
21 env->set_context_factory(&context_factory_);
sadrul 2017/05/04 17:50:46 I think you want to do this first, before seeing u
Alex Z. 2017/05/04 18:01:16 AuraTestBase::SetUp() create an InProcessContextFa
Alex Z. 2017/05/05 13:34:44 I added a comment explaining this here.
22 }
23
24 void AuraMusWmTestBase::TearDown() {
25 aura::Env::GetInstance()->set_context_factory(context_factory_to_restore_);
26 AuraTestBase::TearDown();
17 } 27 }
18 28
19 AuraMusClientTestBase::AuraMusClientTestBase() {} 29 AuraMusClientTestBase::AuraMusClientTestBase() {}
20 30
21 AuraMusClientTestBase::~AuraMusClientTestBase() {} 31 AuraMusClientTestBase::~AuraMusClientTestBase() {}
22 32
23 void AuraMusClientTestBase::SetUp() { 33 void AuraMusClientTestBase::SetUp() {
24 EnableMusWithTestWindowTree(); 34 EnableMusWithTestWindowTree();
25 set_window_manager_delegate(nullptr); 35 set_window_manager_delegate(nullptr);
sadrul 2017/05/04 17:50:46 I think we should do this here too.
Alex Z. 2017/05/04 18:01:16 All aura_unittests passed without changing AuraMus
Alex Z. 2017/05/05 13:34:44 Done.
26 AuraTestBase::SetUp(); 36 AuraTestBase::SetUp();
27 } 37 }
28 38
29 } // namespace test 39 } // namespace test
30 } // namespace aura 40 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/aura_mus_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698