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

Side by Side Diff: ui/views/test/views_test_base.h

Issue 1995613003: views/mus: Fix some flaky crashes during test teardown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views-mus-more-focus-fix
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/mus/surface_context_factory.cc ('k') | ui/views/test/views_test_base.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 #ifndef UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ 5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_BASE_H_
6 #define UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ 6 #define UI_VIEWS_TEST_VIEWS_TEST_BASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 24 matching lines...) Expand all
35 // testing::Test: 35 // testing::Test:
36 void SetUp() override; 36 void SetUp() override;
37 void TearDown() override; 37 void TearDown() override;
38 38
39 void RunPendingMessages(); 39 void RunPendingMessages();
40 40
41 // Creates a widget of |type| with any platform specific data for use in 41 // Creates a widget of |type| with any platform specific data for use in
42 // cross-platform tests. 42 // cross-platform tests.
43 Widget::InitParams CreateParams(Widget::InitParams::Type type); 43 Widget::InitParams CreateParams(Widget::InitParams::Type type);
44 44
45 // Use for tests that you should not create a NativeWidgetMus. Ideally we
46 // would use an ifdef, but for the time being we're not compiling differently,
47 // so that a define is not possible.
48 void DisableNativeWidgetMus();
49
50 protected: 45 protected:
51 TestViewsDelegate* views_delegate() const { 46 TestViewsDelegate* views_delegate() const {
52 return test_helper_->views_delegate(); 47 return test_helper_->views_delegate();
53 } 48 }
54 49
55 void set_views_delegate(std::unique_ptr<TestViewsDelegate> views_delegate) { 50 void set_views_delegate(std::unique_ptr<TestViewsDelegate> views_delegate) {
56 DCHECK(!setup_called_); 51 DCHECK(!setup_called_);
57 views_delegate_for_setup_.swap(views_delegate); 52 views_delegate_for_setup_.swap(views_delegate);
58 } 53 }
59 54
(...skipping 13 matching lines...) Expand all
73 #if defined(OS_WIN) 68 #if defined(OS_WIN)
74 ui::ScopedOleInitializer ole_initializer_; 69 ui::ScopedOleInitializer ole_initializer_;
75 #endif 70 #endif
76 71
77 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); 72 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase);
78 }; 73 };
79 74
80 } // namespace views 75 } // namespace views
81 76
82 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_ 77 #endif // UI_VIEWS_TEST_VIEWS_TEST_BASE_H_
OLDNEW
« no previous file with comments | « ui/views/mus/surface_context_factory.cc ('k') | ui/views/test/views_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698