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

Side by Side Diff: ui/keyboard/keyboard_controller_unittest.cc

Issue 2620273002: Change the keyboard bounds when moving to another display. (Closed)
Patch Set: Fix a test failure Created 3 years, 11 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
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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 TEST_F(KeyboardControllerTest, KeyboardSize) { 293 TEST_F(KeyboardControllerTest, KeyboardSize) {
294 aura::Window* container(controller()->GetContainerWindow()); 294 aura::Window* container(controller()->GetContainerWindow());
295 aura::Window* keyboard(ui()->GetKeyboardWindow()); 295 aura::Window* keyboard(ui()->GetKeyboardWindow());
296 gfx::Rect screen_bounds = root_window()->bounds(); 296 gfx::Rect screen_bounds = root_window()->bounds();
297 root_window()->AddChild(container); 297 root_window()->AddChild(container);
298 container->AddChild(keyboard); 298 container->AddChild(keyboard);
299 const gfx::Rect& initial_bounds = container->bounds(); 299 const gfx::Rect& initial_bounds = container->bounds();
300 // The container should be positioned at the bottom of screen and has 0 300 // The container should be positioned at the bottom of screen and has 0
301 // height. 301 // height.
302 ASSERT_EQ(gfx::Rect(), initial_bounds); 302 ASSERT_EQ(0, initial_bounds.height());
303 ASSERT_EQ(screen_bounds.height(), initial_bounds.y());
303 VerifyKeyboardWindowSize(container, keyboard); 304 VerifyKeyboardWindowSize(container, keyboard);
304 305
305 // In FULL_WIDTH mode, attempt to change window width or move window up from 306 // In FULL_WIDTH mode, attempt to change window width or move window up from
306 // the bottom are ignored. Changing window height is supported. 307 // the bottom are ignored. Changing window height is supported.
307 gfx::Rect expected_bounds(0, 308 gfx::Rect expected_bounds(0,
308 screen_bounds.height() - 50, 309 screen_bounds.height() - 50,
309 screen_bounds.width(), 310 screen_bounds.width(),
310 50); 311 50);
311 312
312 // The x position of new bounds may not be 0 if shelf is on the left side of 313 // The x position of new bounds may not be 0 if shelf is on the left side of
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 gfx::Rect new_bounds(0, 0, 1280, 800); 701 gfx::Rect new_bounds(0, 0, 1280, 800);
701 ASSERT_NE(new_bounds, root_window()->bounds()); 702 ASSERT_NE(new_bounds, root_window()->bounds());
702 EXPECT_EQ(1, number_of_calls()); 703 EXPECT_EQ(1, number_of_calls());
703 root_window()->SetBounds(new_bounds); 704 root_window()->SetBounds(new_bounds);
704 EXPECT_EQ(2, number_of_calls()); 705 EXPECT_EQ(2, number_of_calls());
705 MockRotateScreen(); 706 MockRotateScreen();
706 EXPECT_EQ(3, number_of_calls()); 707 EXPECT_EQ(3, number_of_calls());
707 } 708 }
708 709
709 } // namespace keyboard 710 } // namespace keyboard
OLDNEW
« ui/keyboard/keyboard_controller.cc ('K') | « ui/keyboard/keyboard_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698