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

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

Issue 659233002: STASH: Epic Experimental patch for toolkit-views App List on Mac Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Fix a few things. Works@master Created 6 years, 2 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/test/test_views_delegate.h ('k') | ui/views/view.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 #include "ui/views/test/views_test_base.h" 5 #include "ui/views/test/views_test_base.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "ui/base/clipboard/clipboard.h" 8 #include "ui/base/clipboard/clipboard.h"
9 #include "ui/base/ime/input_method_initializer.h" 9 #include "ui/base/ime/input_method_initializer.h"
10 #include "ui/compositor/test/context_factories_for_test.h" 10 #include "ui/compositor/test/context_factories_for_test.h"
(...skipping 12 matching lines...) Expand all
23 CHECK(teardown_called_) 23 CHECK(teardown_called_)
24 << "You have overridden TearDown but never called super class's TearDown"; 24 << "You have overridden TearDown but never called super class's TearDown";
25 } 25 }
26 26
27 void ViewsTestBase::SetUp() { 27 void ViewsTestBase::SetUp() {
28 testing::Test::SetUp(); 28 testing::Test::SetUp();
29 setup_called_ = true; 29 setup_called_ = true;
30 if (!views_delegate_.get()) 30 if (!views_delegate_.get())
31 views_delegate_.reset(new TestViewsDelegate()); 31 views_delegate_.reset(new TestViewsDelegate());
32 // The ContextFactory must exist before any Compositors are created. 32 // The ContextFactory must exist before any Compositors are created.
33 ui::ContextFactory* context_factory = NULL;
34 #if !defined(OS_MACOSX)
33 bool enable_pixel_output = false; 35 bool enable_pixel_output = false;
34 ui::ContextFactory* context_factory = 36 context_factory = ui::InitializeContextFactoryForTests(enable_pixel_output);
35 ui::InitializeContextFactoryForTests(enable_pixel_output); 37 #endif
36 38
37 test_helper_.reset(ViewsTestHelper::Create(&message_loop_, context_factory)); 39 test_helper_.reset(ViewsTestHelper::Create(&message_loop_, context_factory));
38 test_helper_->SetUp(); 40 test_helper_->SetUp();
39 ui::InitializeInputMethodForTesting(); 41 ui::InitializeInputMethodForTesting();
40 } 42 }
41 43
42 void ViewsTestBase::TearDown() { 44 void ViewsTestBase::TearDown() {
43 ui::Clipboard::DestroyClipboardForCurrentThread(); 45 ui::Clipboard::DestroyClipboardForCurrentThread();
44 46
45 // Flush the message loop because we have pending release tasks 47 // Flush the message loop because we have pending release tasks
(...skipping 17 matching lines...) Expand all
63 Widget::InitParams params(type); 65 Widget::InitParams params(type);
64 params.context = GetContext(); 66 params.context = GetContext();
65 return params; 67 return params;
66 } 68 }
67 69
68 gfx::NativeWindow ViewsTestBase::GetContext() { 70 gfx::NativeWindow ViewsTestBase::GetContext() {
69 return test_helper_->GetContext(); 71 return test_helper_->GetContext();
70 } 72 }
71 73
72 } // namespace views 74 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/test_views_delegate.h ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698