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

Side by Side Diff: ui/keyboard/keyboard_controller_unittest.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
« no previous file with comments | « ui/compositor/test/test_compositor_host_x11.cc ('k') | ui/snapshot/snapshot_aura_unittest.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/keyboard/keyboard_controller.h" 5 #include "ui/keyboard/keyboard_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 class KeyboardControllerTest : public testing::Test, 184 class KeyboardControllerTest : public testing::Test,
185 public KeyboardControllerObserver { 185 public KeyboardControllerObserver {
186 public: 186 public:
187 KeyboardControllerTest() 187 KeyboardControllerTest()
188 : number_of_calls_(0), ui_(nullptr), keyboard_closed_(false) {} 188 : number_of_calls_(0), ui_(nullptr), keyboard_closed_(false) {}
189 ~KeyboardControllerTest() override {} 189 ~KeyboardControllerTest() override {}
190 190
191 void SetUp() override { 191 void SetUp() override {
192 // The ContextFactory must exist before any Compositors are created. 192 // The ContextFactory must exist before any Compositors are created.
193 bool enable_pixel_output = false; 193 bool enable_pixel_output = false;
194 ui::ContextFactory* context_factory = 194 ui::ContextFactory* context_factory = nullptr;
195 ui::InitializeContextFactoryForTests(enable_pixel_output); 195 ui::ContextFactoryPrivate* context_factory_private = nullptr;
196
197 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
198 &context_factory_private);
196 199
197 ui::SetUpInputMethodFactoryForTesting(); 200 ui::SetUpInputMethodFactoryForTesting();
198 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); 201 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
199 aura_test_helper_->SetUp(context_factory); 202 aura_test_helper_->SetUp(context_factory, context_factory_private);
200 new wm::DefaultActivationClient(aura_test_helper_->root_window()); 203 new wm::DefaultActivationClient(aura_test_helper_->root_window());
201 focus_controller_.reset(new TestFocusController(root_window())); 204 focus_controller_.reset(new TestFocusController(root_window()));
202 ui_ = new TestKeyboardUI(aura_test_helper_->host()->GetInputMethod()); 205 ui_ = new TestKeyboardUI(aura_test_helper_->host()->GetInputMethod());
203 layout_delegate_.reset(new TestKeyboardLayoutDelegate()); 206 layout_delegate_.reset(new TestKeyboardLayoutDelegate());
204 controller_.reset(new KeyboardController(ui_, layout_delegate_.get())); 207 controller_.reset(new KeyboardController(ui_, layout_delegate_.get()));
205 controller()->AddObserver(this); 208 controller()->AddObserver(this);
206 } 209 }
207 210
208 void TearDown() override { 211 void TearDown() override {
209 if (controller()) 212 if (controller())
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 gfx::Rect new_bounds(0, 0, 1280, 800); 700 gfx::Rect new_bounds(0, 0, 1280, 800);
698 ASSERT_NE(new_bounds, root_window()->bounds()); 701 ASSERT_NE(new_bounds, root_window()->bounds());
699 EXPECT_EQ(1, number_of_calls()); 702 EXPECT_EQ(1, number_of_calls());
700 root_window()->SetBounds(new_bounds); 703 root_window()->SetBounds(new_bounds);
701 EXPECT_EQ(2, number_of_calls()); 704 EXPECT_EQ(2, number_of_calls());
702 MockRotateScreen(); 705 MockRotateScreen();
703 EXPECT_EQ(3, number_of_calls()); 706 EXPECT_EQ(3, number_of_calls());
704 } 707 }
705 708
706 } // namespace keyboard 709 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/compositor/test/test_compositor_host_x11.cc ('k') | ui/snapshot/snapshot_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698