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

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

Issue 544173006: Fix animation distance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « ui/keyboard/keyboard_controller.cc ('k') | no next file » | 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 TEST_F(KeyboardControllerAnimationTest, ContainerAnimation) { 513 TEST_F(KeyboardControllerAnimationTest, ContainerAnimation) {
514 ui::Layer* layer = keyboard_container()->layer(); 514 ui::Layer* layer = keyboard_container()->layer();
515 ShowKeyboard(); 515 ShowKeyboard();
516 516
517 // Keyboard container and window should immediately become visible before 517 // Keyboard container and window should immediately become visible before
518 // animation starts. 518 // animation starts.
519 EXPECT_TRUE(keyboard_container()->IsVisible()); 519 EXPECT_TRUE(keyboard_container()->IsVisible());
520 EXPECT_TRUE(keyboard_window()->IsVisible()); 520 EXPECT_TRUE(keyboard_window()->IsVisible());
521 float show_start_opacity = layer->opacity(); 521 float show_start_opacity = layer->opacity();
522 gfx::Transform transform; 522 gfx::Transform transform;
523 transform.Translate(0, keyboard_window()->bounds().height()); 523 transform.Translate(0, kAnimationDistance);
524 EXPECT_EQ(transform, layer->transform()); 524 EXPECT_EQ(transform, layer->transform());
525 EXPECT_EQ(gfx::Rect(), notified_bounds()); 525 EXPECT_EQ(gfx::Rect(), notified_bounds());
526 526
527 RunAnimationForLayer(layer); 527 RunAnimationForLayer(layer);
528 EXPECT_TRUE(keyboard_container()->IsVisible()); 528 EXPECT_TRUE(keyboard_container()->IsVisible());
529 EXPECT_TRUE(keyboard_window()->IsVisible()); 529 EXPECT_TRUE(keyboard_window()->IsVisible());
530 float show_end_opacity = layer->opacity(); 530 float show_end_opacity = layer->opacity();
531 EXPECT_LT(show_start_opacity, show_end_opacity); 531 EXPECT_LT(show_start_opacity, show_end_opacity);
532 EXPECT_EQ(gfx::Transform(), layer->transform()); 532 EXPECT_EQ(gfx::Transform(), layer->transform());
533 // KeyboardController should notify the bounds of keyboard window to its 533 // KeyboardController should notify the bounds of keyboard window to its
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 SetFocus(&input_client); 600 SetFocus(&input_client);
601 EXPECT_TRUE(keyboard_container->IsVisible()); 601 EXPECT_TRUE(keyboard_container->IsVisible());
602 602
603 SetFocus(&no_input_client); 603 SetFocus(&no_input_client);
604 // Keyboard should not hide itself after lost focus. 604 // Keyboard should not hide itself after lost focus.
605 EXPECT_TRUE(keyboard_container->IsVisible()); 605 EXPECT_TRUE(keyboard_container->IsVisible());
606 EXPECT_FALSE(WillHideKeyboard()); 606 EXPECT_FALSE(WillHideKeyboard());
607 } 607 }
608 608
609 } // namespace keyboard 609 } // namespace keyboard
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698