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

Unified Diff: ui/keyboard/keyboard_controller_unittest.cc

Issue 97013002: [Input View] Makes the input view window support window.resizeTo() and w3c visibility API its web c… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/keyboard/keyboard_controller_unittest.cc
diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc
index 9c2023d782a087f3bfcd74534ebc117eda32ea1c..05a7dfc6bc2f0c2f44a5fece5fdec8f93074fe1a 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/client/focus_client.h"
+#include "ui/aura/layout_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/aura_test_helper.h"
#include "ui/aura/test/event_generator.h"
@@ -334,6 +335,34 @@ TEST_F(KeyboardControllerTest, VisibilityChangeWithTextInputTypeChange) {
EXPECT_TRUE(keyboard_container->IsVisible());
}
+TEST_F(KeyboardControllerTest, KeyboardResizingFromContents) {
+ aura::Window* keyboard_container(controller()->GetContainerWindow());
+ aura::Window* keyboard_window(proxy()->GetKeyboardWindow());
oshima 2013/12/12 01:53:24 nit: use = for consistency
Shu Chen 2013/12/12 02:34:29 Done.
+ keyboard_container->SetBounds(gfx::Rect(800, 600));
+ keyboard_container->AddChild(keyboard_window);
+
+ // Default keyboard size.
+ EXPECT_EQ(180, keyboard_window->bounds().height());
+
+ // Resizes from contents when flag is unset.
+ keyboard_window->SetBounds(gfx::Rect(100, 80));
+ EXPECT_EQ(180, keyboard_window->bounds().height());
+
+ // Resizes from contents when flag is set.
+ proxy()->set_resizing_from_contents(true);
+ keyboard_window->SetBounds(gfx::Rect(100, 80));
+ EXPECT_EQ(80, keyboard_window->bounds().height());
+
+ // Resizes from container when flag is set.
+ keyboard_container->SetBounds(gfx::Rect(400, 300));
+ EXPECT_EQ(80, keyboard_window->bounds().height());
+
+ // Resizes from container when flag is unset.
+ proxy()->set_resizing_from_contents(false);
+ keyboard_container->SetBounds(gfx::Rect(800, 600));
+ EXPECT_EQ(180, keyboard_window->bounds().height());
+}
+
class KeyboardControllerUsabilityTest : public KeyboardControllerTest {
public:
KeyboardControllerUsabilityTest() {}
« ui/keyboard/keyboard_controller_proxy.cc ('K') | « ui/keyboard/keyboard_controller_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698