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

Unified Diff: chrome/browser/ui/ash/ash_keyboard_controller_proxy_browsertest.cc

Issue 134133003: Fix VK animation related issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/ash_keyboard_controller_proxy.cc ('k') | ui/keyboard/keyboard_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/ash_keyboard_controller_proxy_browsertest.cc
diff --git a/chrome/browser/ui/ash/ash_keyboard_controller_proxy_browsertest.cc b/chrome/browser/ui/ash/ash_keyboard_controller_proxy_browsertest.cc
index 9518b072768efdb0f343b9e5d624c0cae7a24116..951d468cb805c965ae3518581cf145bc581f5219 100644
--- a/chrome/browser/ui/ash/ash_keyboard_controller_proxy_browsertest.cc
+++ b/chrome/browser/ui/ash/ash_keyboard_controller_proxy_browsertest.cc
@@ -133,7 +133,7 @@ TEST_F(AshKeyboardControllerProxyTest, VirtualKeyboardContainerAnimation) {
// animation starts.
EXPECT_TRUE(keyboard_container->IsVisible());
EXPECT_TRUE(proxy()->GetKeyboardWindow()->IsVisible());
- EXPECT_EQ(0.0, layer->opacity());
+ float show_start_opacity = layer->opacity();
gfx::Transform transform;
transform.Translate(0, proxy()->GetKeyboardWindow()->bounds().height());
EXPECT_EQ(transform, layer->transform());
@@ -141,18 +141,45 @@ TEST_F(AshKeyboardControllerProxyTest, VirtualKeyboardContainerAnimation) {
RunAnimationForLayer(layer);
EXPECT_TRUE(keyboard_container->IsVisible());
EXPECT_TRUE(proxy()->GetKeyboardWindow()->IsVisible());
- EXPECT_EQ(1.0, layer->opacity());
+ float show_end_opacity = layer->opacity();
+ EXPECT_LT(show_start_opacity, show_end_opacity);
EXPECT_EQ(gfx::Transform(), layer->transform());
HideKeyboard(keyboard_container);
- // Keyboard container and window should be visible before hide animation
- // finishes.
EXPECT_TRUE(keyboard_container->IsVisible());
+ EXPECT_TRUE(keyboard_container->layer()->visible());
EXPECT_TRUE(proxy()->GetKeyboardWindow()->IsVisible());
+ float hide_start_opacity = layer->opacity();
RunAnimationForLayer(layer);
EXPECT_FALSE(keyboard_container->IsVisible());
+ EXPECT_FALSE(keyboard_container->layer()->visible());
EXPECT_FALSE(proxy()->GetKeyboardWindow()->IsVisible());
- EXPECT_EQ(0.0, layer->opacity());
+ float hide_end_opacity = layer->opacity();
+ EXPECT_GT(hide_start_opacity, hide_end_opacity);
EXPECT_EQ(transform, layer->transform());
}
+
+// Test for crbug.com/333284.
+TEST_F(AshKeyboardControllerProxyTest, VirtualKeyboardContainerShowWhileHide) {
+ // We cannot short-circuit animations for this test.
+ ui::ScopedAnimationDurationScaleMode normal_duration_mode(
+ ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
+
+ aura::Window* keyboard_container(controller()->GetContainerWindow());
+ ui::Layer* layer = keyboard_container->layer();
+
+ EXPECT_FALSE(keyboard_container->IsVisible());
+ ShowKeyboard(keyboard_container);
+ RunAnimationForLayer(layer);
+
+ HideKeyboard(keyboard_container);
+ // Before hide animation finishes, show keyboard again.
+ ShowKeyboard(keyboard_container);
+
+ RunAnimationForLayer(layer);
+ EXPECT_TRUE(keyboard_container->IsVisible());
+ EXPECT_TRUE(proxy()->GetKeyboardWindow()->IsVisible());
+ EXPECT_EQ(1.0, layer->opacity());
+ EXPECT_EQ(gfx::Transform(), layer->transform());
+}
« no previous file with comments | « chrome/browser/ui/ash/ash_keyboard_controller_proxy.cc ('k') | ui/keyboard/keyboard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698