OLD | NEW |
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 ui::SetUpInputMethodFactoryForTesting(); | 234 ui::SetUpInputMethodFactoryForTesting(); |
235 aura_test_helper_.reset(new aura::test::AuraTestHelper()); | 235 aura_test_helper_.reset(new aura::test::AuraTestHelper()); |
236 aura_test_helper_->SetUp(context_factory, context_factory_private); | 236 aura_test_helper_->SetUp(context_factory, context_factory_private); |
237 new wm::DefaultActivationClient(aura_test_helper_->root_window()); | 237 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
238 focus_controller_.reset(new TestFocusController(root_window())); | 238 focus_controller_.reset(new TestFocusController(root_window())); |
239 ui_ = new TestKeyboardUI(aura_test_helper_->host()->GetInputMethod()); | 239 ui_ = new TestKeyboardUI(aura_test_helper_->host()->GetInputMethod()); |
240 layout_delegate_.reset(new TestKeyboardLayoutDelegate()); | 240 layout_delegate_.reset(new TestKeyboardLayoutDelegate()); |
241 controller_.reset(new KeyboardController(ui_, layout_delegate_.get())); | 241 controller_.reset(new KeyboardController(ui_, layout_delegate_.get())); |
242 controller()->AddObserver(this); | 242 controller()->AddObserver(this); |
243 | 243 |
244 if (GetParam()) { | 244 if (!GetParam()) { |
245 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 245 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
246 command_line->AppendSwitch(::switches::kUseNewVirtualKeyboardBehavior); | 246 command_line->AppendSwitch( |
| 247 ::switches::kDisableNewVirtualKeyboardBehavior); |
247 } | 248 } |
248 } | 249 } |
249 | 250 |
250 void TearDown() override { | 251 void TearDown() override { |
251 if (controller()) | 252 if (controller()) |
252 controller()->RemoveObserver(this); | 253 controller()->RemoveObserver(this); |
253 controller_.reset(); | 254 controller_.reset(); |
254 focus_controller_.reset(); | 255 focus_controller_.reset(); |
255 aura_test_helper_->TearDown(); | 256 aura_test_helper_->TearDown(); |
256 ui::TerminateContextFactoryForTests(); | 257 ui::TerminateContextFactoryForTests(); |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 gfx::Rect new_bounds(0, 0, 1280, 800); | 781 gfx::Rect new_bounds(0, 0, 1280, 800); |
781 ASSERT_NE(new_bounds, root_window()->bounds()); | 782 ASSERT_NE(new_bounds, root_window()->bounds()); |
782 EXPECT_EQ(1, number_of_calls()); | 783 EXPECT_EQ(1, number_of_calls()); |
783 root_window()->SetBounds(new_bounds); | 784 root_window()->SetBounds(new_bounds); |
784 EXPECT_EQ(2, number_of_calls()); | 785 EXPECT_EQ(2, number_of_calls()); |
785 MockRotateScreen(); | 786 MockRotateScreen(); |
786 EXPECT_EQ(3, number_of_calls()); | 787 EXPECT_EQ(3, number_of_calls()); |
787 } | 788 } |
788 | 789 |
789 } // namespace keyboard | 790 } // namespace keyboard |
OLD | NEW |