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

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

Issue 1508303003: Show floating VK on first tap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | ui/keyboard/keyboard_layout_manager.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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 controller()->HideKeyboard(KeyboardController::HIDE_REASON_AUTOMATIC); 605 controller()->HideKeyboard(KeyboardController::HIDE_REASON_AUTOMATIC);
606 // Before hide animation finishes, show keyboard again. 606 // Before hide animation finishes, show keyboard again.
607 ShowKeyboard(); 607 ShowKeyboard();
608 RunAnimationForLayer(layer); 608 RunAnimationForLayer(layer);
609 EXPECT_TRUE(keyboard_container()->IsVisible()); 609 EXPECT_TRUE(keyboard_container()->IsVisible());
610 EXPECT_TRUE(keyboard_window()->IsVisible()); 610 EXPECT_TRUE(keyboard_window()->IsVisible());
611 EXPECT_EQ(1.0, layer->opacity()); 611 EXPECT_EQ(1.0, layer->opacity());
612 EXPECT_EQ(gfx::Transform(), layer->transform()); 612 EXPECT_EQ(gfx::Transform(), layer->transform());
613 } 613 }
614 614
615 // Test for crbug.com/568274.
616 TEST_F(KeyboardControllerTest, FloatingKeyboardShowOnFirstTap) {
617 aura::Window* container(controller()->GetContainerWindow());
618 aura::Window* keyboard(ui()->GetKeyboardWindow());
619 root_window()->AddChild(container);
620 controller()->SetKeyboardMode(FLOATING);
621 container->AddChild(keyboard);
622 // Mock focus on an input field.
623 ui()->GetInputMethod()->ShowImeIfNeeded();
624 // Mock set keyboard size from javascript side. In floating mode, virtual
625 // keyboard's size is decided by client.
626 gfx::Rect new_bounds(0, 50, 50, 50);
627 keyboard->SetBounds(new_bounds);
628 ASSERT_EQ(new_bounds, container->bounds());
629 EXPECT_TRUE(keyboard->IsVisible());
630 EXPECT_TRUE(container->IsVisible());
631 }
632
615 } // namespace keyboard 633 } // namespace keyboard
OLDNEW
« no previous file with comments | « no previous file | ui/keyboard/keyboard_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698