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

Side by Side Diff: chrome/test/base/view_event_test_base.cc

Issue 785233008: MacViews: Use views::TestViewsDelegate in ViewEventTestBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: needs set_use_desktop_native_widgets Created 6 years 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 | « chrome/test/base/view_event_test_base.h ('k') | no next file » | 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 "chrome/test/base/view_event_test_base.h" 5 #include "chrome/test/base/view_event_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/test/base/chrome_unit_test_suite.h" 9 #include "chrome/test/base/chrome_unit_test_suite.h"
10 #include "chrome/test/base/interactive_test_utils.h" 10 #include "chrome/test/base/interactive_test_utils.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 void ViewEventTestBase::SetUp() { 77 void ViewEventTestBase::SetUp() {
78 views::ViewsDelegate::views_delegate = &views_delegate_; 78 views::ViewsDelegate::views_delegate = &views_delegate_;
79 ui::InitializeInputMethodForTesting(); 79 ui::InitializeInputMethodForTesting();
80 80
81 // The ContextFactory must exist before any Compositors are created. 81 // The ContextFactory must exist before any Compositors are created.
82 bool enable_pixel_output = false; 82 bool enable_pixel_output = false;
83 ui::ContextFactory* context_factory = 83 ui::ContextFactory* context_factory =
84 ui::InitializeContextFactoryForTests(enable_pixel_output); 84 ui::InitializeContextFactoryForTests(enable_pixel_output);
85 views_delegate_.set_context_factory(context_factory);
86 views_delegate_.set_use_desktop_native_widgets(true);
85 87
86 platform_part_.reset(ViewEventTestPlatformPart::Create(context_factory)); 88 platform_part_.reset(ViewEventTestPlatformPart::Create(context_factory));
87 gfx::NativeWindow context = platform_part_->GetContext(); 89 gfx::NativeWindow context = platform_part_->GetContext();
88 window_ = views::Widget::CreateWindowWithContext(this, context); 90 window_ = views::Widget::CreateWindowWithContext(this, context);
89 } 91 }
90 92
91 void ViewEventTestBase::TearDown() { 93 void ViewEventTestBase::TearDown() {
92 if (window_) { 94 if (window_) {
93 window_->Close(); 95 window_->Close();
94 content::RunAllPendingInMessageLoop(); 96 content::RunAllPendingInMessageLoop();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 dnd_thread_.reset(NULL); 168 dnd_thread_.reset(NULL);
167 } 169 }
168 170
169 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { 171 void ViewEventTestBase::RunTestMethod(const base::Closure& task) {
170 StopBackgroundThread(); 172 StopBackgroundThread();
171 173
172 task.Run(); 174 task.Run();
173 if (HasFatalFailure()) 175 if (HasFatalFailure())
174 Done(); 176 Done();
175 } 177 }
OLDNEW
« no previous file with comments | « chrome/test/base/view_event_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698