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

Side by Side Diff: ui/views/test/views_test_base.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/views_test_base.h ('k') | ui/views/widget/widget_interactive_uitest.cc » ('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 (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/run_loop.h" 9 #include "base/run_loop.h"
10 #include "ui/base/clipboard/clipboard.h" 10 #include "ui/base/clipboard/clipboard.h"
11 #include "ui/base/material_design/material_design_controller.h" 11 #include "ui/base/material_design/material_design_controller.h"
12 #include "ui/base/test/material_design_controller_test_api.h" 12 #include "ui/base/test/material_design_controller_test_api.h"
13 #include "ui/views/test/platform_test_helper.h"
14 13
15 namespace views { 14 namespace views {
16 15
17 ViewsTestBase::ViewsTestBase() 16 ViewsTestBase::ViewsTestBase()
18 : setup_called_(false), 17 : setup_called_(false),
19 teardown_called_(false) { 18 teardown_called_(false) {
20 } 19 }
21 20
22 ViewsTestBase::~ViewsTestBase() { 21 ViewsTestBase::~ViewsTestBase() {
23 CHECK(setup_called_) 22 CHECK(setup_called_)
24 << "You have overridden SetUp but never called super class's SetUp"; 23 << "You have overridden SetUp but never called super class's SetUp";
25 CHECK(teardown_called_) 24 CHECK(teardown_called_)
26 << "You have overridden TearDown but never called super class's TearDown"; 25 << "You have overridden TearDown but never called super class's TearDown";
27 } 26 }
28 27
29 // static
30 bool ViewsTestBase::IsMus() {
31 return PlatformTestHelper::IsMus();
32 }
33
34 void ViewsTestBase::SetUp() { 28 void ViewsTestBase::SetUp() {
35 testing::Test::SetUp(); 29 testing::Test::SetUp();
36 // ContentTestSuiteBase might have already initialized 30 // ContentTestSuiteBase might have already initialized
37 // MaterialDesignController in unit_tests suite. 31 // MaterialDesignController in unit_tests suite.
38 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); 32 ui::test::MaterialDesignControllerTestAPI::Uninitialize();
39 ui::MaterialDesignController::Initialize(); 33 ui::MaterialDesignController::Initialize();
40 setup_called_ = true; 34 setup_called_ = true;
41 if (!views_delegate_for_setup_) 35 if (!views_delegate_for_setup_)
42 views_delegate_for_setup_.reset(new TestViewsDelegate()); 36 views_delegate_for_setup_.reset(new TestViewsDelegate());
43 37
(...skipping 26 matching lines...) Expand all
70 64
71 void ViewsTestBase::DisableNativeWidgetMus() { 65 void ViewsTestBase::DisableNativeWidgetMus() {
72 ViewsDelegate::GetInstance()->set_native_widget_factory( 66 ViewsDelegate::GetInstance()->set_native_widget_factory(
73 ViewsDelegate::NativeWidgetFactory()); 67 ViewsDelegate::NativeWidgetFactory());
74 } 68 }
75 69
76 gfx::NativeWindow ViewsTestBase::GetContext() { 70 gfx::NativeWindow ViewsTestBase::GetContext() {
77 return test_helper_->GetContext(); 71 return test_helper_->GetContext();
78 } 72 }
79 73
74 bool ViewsTestBase::IsMus() const {
75 return test_helper_->IsMus();
76 }
77
80 } // namespace views 78 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/views_test_base.h ('k') | ui/views/widget/widget_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698