OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views_test_base.h" | 5 #include "ui/views/test/views_test_base.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 << "You have overridden SetUp but never called super class's SetUp"; | 57 << "You have overridden SetUp but never called super class's SetUp"; |
58 CHECK(teardown_called_) | 58 CHECK(teardown_called_) |
59 << "You have overridden TearDown but never called super class's TearDown"; | 59 << "You have overridden TearDown but never called super class's TearDown"; |
60 } | 60 } |
61 | 61 |
62 // static | 62 // static |
63 bool ViewsTestBase::IsMus() { | 63 bool ViewsTestBase::IsMus() { |
64 return PlatformTestHelper::IsMus(); | 64 return PlatformTestHelper::IsMus(); |
65 } | 65 } |
66 | 66 |
67 // static | |
68 bool ViewsTestBase::IsAuraMusClient() { | |
69 return PlatformTestHelper::IsAuraMusClient(); | |
70 } | |
71 | |
72 void ViewsTestBase::SetUp() { | 67 void ViewsTestBase::SetUp() { |
73 testing::Test::SetUp(); | 68 testing::Test::SetUp(); |
74 // ContentTestSuiteBase might have already initialized | 69 // ContentTestSuiteBase might have already initialized |
75 // MaterialDesignController in unit_tests suite. | 70 // MaterialDesignController in unit_tests suite. |
76 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 71 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
77 ui::MaterialDesignController::Initialize(); | 72 ui::MaterialDesignController::Initialize(); |
78 setup_called_ = true; | 73 setup_called_ = true; |
79 if (!views_delegate_for_setup_) | 74 if (!views_delegate_for_setup_) |
80 views_delegate_for_setup_.reset(new TestViewsDelegate()); | 75 views_delegate_for_setup_.reset(new TestViewsDelegate()); |
81 | 76 |
(...skipping 30 matching lines...) Expand all Loading... |
112 | 107 |
113 void ViewsTestBase::SimulateNativeDestroy(Widget* widget) { | 108 void ViewsTestBase::SimulateNativeDestroy(Widget* widget) { |
114 test_helper_->platform_test_helper()->SimulateNativeDestroy(widget); | 109 test_helper_->platform_test_helper()->SimulateNativeDestroy(widget); |
115 } | 110 } |
116 | 111 |
117 gfx::NativeWindow ViewsTestBase::GetContext() { | 112 gfx::NativeWindow ViewsTestBase::GetContext() { |
118 return test_helper_->GetContext(); | 113 return test_helper_->GetContext(); |
119 } | 114 } |
120 | 115 |
121 } // namespace views | 116 } // namespace views |
OLD | NEW |