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

Side by Side Diff: ui/views/test/scoped_views_test_helper.cc

Issue 1984403002: Revert of Reland: mus: Add views_mus_interactive_ui_tests target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/views/test/scoped_views_test_helper.h ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/views/test/scoped_views_test_helper.h" 5 #include "ui/views/test/scoped_views_test_helper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 26 matching lines...) Expand all
37 context_factory)); 37 context_factory));
38 test_helper_->SetUp(); 38 test_helper_->SetUp();
39 39
40 #if defined(USE_AURA) 40 #if defined(USE_AURA)
41 // When running inside mus, the context-factory from 41 // When running inside mus, the context-factory from
42 // ui::InitializeContextFactoryForTests() is only needed for the default 42 // ui::InitializeContextFactoryForTests() is only needed for the default
43 // WindowTreeHost instance created by TestScreen. After that, the 43 // WindowTreeHost instance created by TestScreen. After that, the
44 // context-factory is used when creating Widgets (to set-up the compositor for 44 // context-factory is used when creating Widgets (to set-up the compositor for
45 // the corresponding mus::Windows). So unset the context-factory, so that 45 // the corresponding mus::Windows). So unset the context-factory, so that
46 // NativeWidgetMus installs the correct context-factory that can talk to mus. 46 // NativeWidgetMus installs the correct context-factory that can talk to mus.
47 if (PlatformTestHelper::IsMus()) 47 if (platform_test_helper_->IsMus())
48 aura::Env::GetInstance()->set_context_factory(nullptr); 48 aura::Env::GetInstance()->set_context_factory(nullptr);
49 #endif 49 #endif
50 50
51 ui::InitializeInputMethodForTesting(); 51 ui::InitializeInputMethodForTesting();
52 } 52 }
53 53
54 ScopedViewsTestHelper::~ScopedViewsTestHelper() { 54 ScopedViewsTestHelper::~ScopedViewsTestHelper() {
55 ui::ShutdownInputMethodForTesting(); 55 ui::ShutdownInputMethodForTesting();
56 test_helper_->TearDown(); 56 test_helper_->TearDown();
57 test_helper_.reset(); 57 test_helper_.reset();
58 58
59 views_delegate_.reset(); 59 views_delegate_.reset();
60 60
61 // The Mus PlatformTestHelper has state that is deleted by 61 // The Mus PlatformTestHelper has state that is deleted by
62 // ui::TerminateContextFactoryForTests(). 62 // ui::TerminateContextFactoryForTests().
63 platform_test_helper_.reset(); 63 platform_test_helper_.reset();
64 64
65 ui::TerminateContextFactoryForTests(); 65 ui::TerminateContextFactoryForTests();
66 } 66 }
67 67
68 gfx::NativeWindow ScopedViewsTestHelper::GetContext() { 68 gfx::NativeWindow ScopedViewsTestHelper::GetContext() {
69 return test_helper_->GetContext(); 69 return test_helper_->GetContext();
70 } 70 }
71 71
72 bool ScopedViewsTestHelper::IsMus() const {
73 return platform_test_helper_->IsMus();
74 }
75
72 } // namespace views 76 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/scoped_views_test_helper.h ('k') | ui/views/test/views_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698