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

Unified Diff: ash/wm/system_modal_container_layout_manager_unittest.cc

Issue 240443006: Remove native VK window height logic and wait for resizeTo to setup VK window height (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/system_modal_container_layout_manager_unittest.cc
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 55f0d8c62376aa361df3170df383b895fe5d0675..568ea50f61b2e7f521fa3a73d8a878a95f02b73c 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -149,8 +149,8 @@ class SystemModalContainerLayoutManagerTest : public AshTestBase {
public:
virtual void SetUp() OVERRIDE {
// Allow a virtual keyboard (and initialize it per default).
- CommandLine::ForCurrentProcess()->AppendSwitch(
- keyboard::switches::kEnableVirtualKeyboard);
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ keyboard::switches::kEnableVirtualKeyboard);
AshTestBase::SetUp();
Shell::GetPrimaryRootWindowController()->ActivateKeyboard(
keyboard::KeyboardController::GetInstance());
@@ -184,31 +184,20 @@ class SystemModalContainerLayoutManagerTest : public AshTestBase {
if (show == keyboard->keyboard_visible())
return;
- // The animation has to run in order to get the notification. Run the
- // animation and wait until its finished.
- ui::ScopedAnimationDurationScaleMode normal_duration_mode(
- ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
- if (show)
- keyboard->ShowAndLockKeyboard();
- else
+ if (show) {
+ keyboard->ShowKeyboard(true);
+ if (keyboard->proxy()->GetKeyboardWindow()->bounds().height() == 0) {
+ keyboard->proxy()->GetKeyboardWindow()->SetBounds(
+ keyboard::KeyboardBoundsFromWindowBounds(
+ keyboard->GetContainerWindow()->bounds(), 100));
+ }
+ } else {
keyboard->HideKeyboard(keyboard::KeyboardController::HIDE_REASON_MANUAL);
-
- WaitForWindowAnimationToBeFinished(keyboard->GetContainerWindow());
+ }
DCHECK_EQ(show, keyboard->keyboard_visible());
}
- void WaitForWindowAnimationToBeFinished(aura::Window* window) {
- DCHECK(window);
- ui::Layer* layer = window->layer();
- ui::LayerAnimatorTestController controller(layer->GetAnimator());
- gfx::AnimationContainerElement* element = layer->GetAnimator();
- while (controller.animator()->is_animating()) {
- controller.StartThreadedAnimationsIfNeeded();
- base::TimeTicks step_time = controller.animator()->last_step_time();
- element->Step(step_time + base::TimeDelta::FromMilliseconds(1000));
- }
- }
};
TEST_F(SystemModalContainerLayoutManagerTest, NonModalTransient) {
« no previous file with comments | « ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698