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

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

Issue 2867663007: Use ScopedTaskEnvironment instead of MessageLoopForUI in ViewsTestBase. (Closed)
Patch Set: self-review 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
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/environment.h" 9 #include "base/environment.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 30 matching lines...) Expand all
41 41
42 return using_argb_visual; 42 return using_argb_visual;
43 #else 43 #else
44 return false; 44 return false;
45 #endif 45 #endif
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 ViewsTestBase::ViewsTestBase() 50 ViewsTestBase::ViewsTestBase()
51 : setup_called_(false), 51 : scoped_task_environment_(
52 base::test::ScopedTaskEnvironment::MainThreadType::UI),
53 setup_called_(false),
52 teardown_called_(false), 54 teardown_called_(false),
53 has_compositing_manager_(InitializeVisuals()) {} 55 has_compositing_manager_(InitializeVisuals()) {}
54 56
55 ViewsTestBase::~ViewsTestBase() { 57 ViewsTestBase::~ViewsTestBase() {
56 CHECK(setup_called_) 58 CHECK(setup_called_)
57 << "You have overridden SetUp but never called super class's SetUp"; 59 << "You have overridden SetUp but never called super class's SetUp";
58 CHECK(teardown_called_) 60 CHECK(teardown_called_)
59 << "You have overridden TearDown but never called super class's TearDown"; 61 << "You have overridden TearDown but never called super class's TearDown";
60 } 62 }
61 63
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 109
108 void ViewsTestBase::SimulateNativeDestroy(Widget* widget) { 110 void ViewsTestBase::SimulateNativeDestroy(Widget* widget) {
109 test_helper_->platform_test_helper()->SimulateNativeDestroy(widget); 111 test_helper_->platform_test_helper()->SimulateNativeDestroy(widget);
110 } 112 }
111 113
112 gfx::NativeWindow ViewsTestBase::GetContext() { 114 gfx::NativeWindow ViewsTestBase::GetContext() {
113 return test_helper_->GetContext(); 115 return test_helper_->GetContext();
114 } 116 }
115 117
116 } // namespace views 118 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/views_test_base.h ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698