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

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

Issue 1782773002: MacViews: Fix ViewTest.HandleAccelerator by faking window activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delay the activatableness Created 4 years, 9 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/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/views/test/views_test_helper.h"
11 12
12 namespace views { 13 namespace views {
13 14
14 ViewsTestBase::ViewsTestBase() 15 ViewsTestBase::ViewsTestBase()
15 : setup_called_(false), 16 : setup_called_(false),
16 teardown_called_(false) { 17 teardown_called_(false) {
17 } 18 }
18 19
19 ViewsTestBase::~ViewsTestBase() { 20 ViewsTestBase::~ViewsTestBase() {
20 CHECK(setup_called_) 21 CHECK(setup_called_)
(...skipping 21 matching lines...) Expand all
42 teardown_called_ = true; 43 teardown_called_ = true;
43 testing::Test::TearDown(); 44 testing::Test::TearDown();
44 test_helper_.reset(); 45 test_helper_.reset();
45 } 46 }
46 47
47 void ViewsTestBase::RunPendingMessages() { 48 void ViewsTestBase::RunPendingMessages() {
48 base::RunLoop run_loop; 49 base::RunLoop run_loop;
49 run_loop.RunUntilIdle(); 50 run_loop.RunUntilIdle();
50 } 51 }
51 52
53 void ViewsTestBase::EnableMacFakeWindowActivation() {
54 test_helper_->views_test_helper()->EnableFakeWindowActivation();
55 }
56
52 Widget::InitParams ViewsTestBase::CreateParams( 57 Widget::InitParams ViewsTestBase::CreateParams(
53 Widget::InitParams::Type type) { 58 Widget::InitParams::Type type) {
54 Widget::InitParams params(type); 59 Widget::InitParams params(type);
55 params.context = GetContext(); 60 params.context = GetContext();
56 return params; 61 return params;
57 } 62 }
58 63
59 gfx::NativeWindow ViewsTestBase::GetContext() { 64 gfx::NativeWindow ViewsTestBase::GetContext() {
60 return test_helper_->GetContext(); 65 return test_helper_->GetContext();
61 } 66 }
62 67
63 } // namespace views 68 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698