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

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

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 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
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/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 void ViewEventTestBase::SetUpTestCase() { 67 void ViewEventTestBase::SetUpTestCase() {
68 ChromeUnitTestSuite::InitializeProviders(); 68 ChromeUnitTestSuite::InitializeProviders();
69 ChromeUnitTestSuite::InitializeResourceBundle(); 69 ChromeUnitTestSuite::InitializeResourceBundle();
70 } 70 }
71 71
72 void ViewEventTestBase::SetUp() { 72 void ViewEventTestBase::SetUp() {
73 ui::InitializeInputMethodForTesting(); 73 ui::InitializeInputMethodForTesting();
74 74
75 // The ContextFactory must exist before any Compositors are created. 75 // The ContextFactory must exist before any Compositors are created.
76 bool enable_pixel_output = false; 76 bool enable_pixel_output = false;
77 ui::ContextFactory* context_factory = 77 ui::ContextFactory* context_factory = nullptr;
78 ui::InitializeContextFactoryForTests(enable_pixel_output); 78 ui::ContextFactoryPrivate* context_factory_private = nullptr;
79
80 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
81 &context_factory_private);
79 views_delegate_.set_context_factory(context_factory); 82 views_delegate_.set_context_factory(context_factory);
83 views_delegate_.set_context_factory_private(context_factory_private);
80 views_delegate_.set_use_desktop_native_widgets(true); 84 views_delegate_.set_use_desktop_native_widgets(true);
81 85
82 platform_part_.reset(ViewEventTestPlatformPart::Create(context_factory)); 86 platform_part_.reset(ViewEventTestPlatformPart::Create(
87 context_factory, context_factory_private));
83 gfx::NativeWindow context = platform_part_->GetContext(); 88 gfx::NativeWindow context = platform_part_->GetContext();
84 window_ = views::Widget::CreateWindowWithContext(this, context); 89 window_ = views::Widget::CreateWindowWithContext(this, context);
85 window_->Show(); 90 window_->Show();
86 } 91 }
87 92
88 void ViewEventTestBase::TearDown() { 93 void ViewEventTestBase::TearDown() {
89 if (window_) { 94 if (window_) {
90 window_->Close(); 95 window_->Close();
91 content::RunAllPendingInMessageLoop(); 96 content::RunAllPendingInMessageLoop();
92 window_ = NULL; 97 window_ = NULL;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 dnd_thread_.reset(NULL); 166 dnd_thread_.reset(NULL);
162 } 167 }
163 168
164 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { 169 void ViewEventTestBase::RunTestMethod(const base::Closure& task) {
165 StopBackgroundThread(); 170 StopBackgroundThread();
166 171
167 task.Run(); 172 task.Run();
168 if (HasFatalFailure()) 173 if (HasFatalFailure())
169 Done(); 174 Done();
170 } 175 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/test/base/view_event_test_platform_part.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698