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

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

Issue 13235003: Support the Text services framework based IME for Chrome AURA on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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 9
10 #if defined(USE_AURA) 10 #if defined(USE_AURA)
11 #include "ui/aura/env.h" 11 #include "ui/aura/env.h"
12 #include "ui/aura/root_window.h" 12 #include "ui/aura/root_window.h"
13 #include "ui/aura/test/aura_test_helper.h" 13 #include "ui/aura/test/aura_test_helper.h"
14 #endif 14 #endif
15 15
16 #if defined(OS_WIN)
17 #include "base/win/metro.h"
18 #include "ui/base/ime/win/tsf_bridge.h"
19 #endif
20
16 namespace views { 21 namespace views {
17 22
18 ViewsTestBase::ViewsTestBase() 23 ViewsTestBase::ViewsTestBase()
19 : setup_called_(false), 24 : setup_called_(false),
20 teardown_called_(false) { 25 teardown_called_(false) {
21 } 26 }
22 27
23 ViewsTestBase::~ViewsTestBase() { 28 ViewsTestBase::~ViewsTestBase() {
24 CHECK(setup_called_) 29 CHECK(setup_called_)
25 << "You have overridden SetUp but never called super class's SetUp"; 30 << "You have overridden SetUp but never called super class's SetUp";
26 CHECK(teardown_called_) 31 CHECK(teardown_called_)
27 << "You have overrideen TearDown but never called super class's TearDown"; 32 << "You have overrideen TearDown but never called super class's TearDown";
28 } 33 }
29 34
30 void ViewsTestBase::SetUp() { 35 void ViewsTestBase::SetUp() {
31 testing::Test::SetUp(); 36 testing::Test::SetUp();
32 setup_called_ = true; 37 setup_called_ = true;
33 if (!views_delegate_.get()) 38 if (!views_delegate_.get())
34 views_delegate_.reset(new TestViewsDelegate()); 39 views_delegate_.reset(new TestViewsDelegate());
35 #if defined(USE_AURA) 40 #if defined(USE_AURA)
36 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); 41 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
37 aura_test_helper_->SetUp(); 42 aura_test_helper_->SetUp();
38 #endif // USE_AURA 43 #endif // USE_AURA
44 #if defined(OS_WIN)
45 if (base::win::IsTSFAwareRequired())
46 ui::TSFBridge::Initialize();
47 #endif
39 } 48 }
40 49
41 void ViewsTestBase::TearDown() { 50 void ViewsTestBase::TearDown() {
42 ui::Clipboard::DestroyClipboardForCurrentThread(); 51 ui::Clipboard::DestroyClipboardForCurrentThread();
43 52
44 // Flush the message loop because we have pending release tasks 53 // Flush the message loop because we have pending release tasks
45 // and these tasks if un-executed would upset Valgrind. 54 // and these tasks if un-executed would upset Valgrind.
46 RunPendingMessages(); 55 RunPendingMessages();
47 teardown_called_ = true; 56 teardown_called_ = true;
48 views_delegate_.reset(); 57 views_delegate_.reset();
(...skipping 22 matching lines...) Expand all
71 80
72 gfx::NativeView ViewsTestBase::GetContext() { 81 gfx::NativeView ViewsTestBase::GetContext() {
73 #if defined(USE_AURA) 82 #if defined(USE_AURA)
74 return aura_test_helper_->root_window(); 83 return aura_test_helper_->root_window();
75 #else 84 #else
76 return NULL; 85 return NULL;
77 #endif 86 #endif
78 } 87 }
79 88
80 } // namespace views 89 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/run_all_unittests.cc ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698