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

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: . 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
« no previous file with comments | « ui/keyboard/keyboard_controller_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5e92385ad400076eca9f44781f125a0628cf66a6 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();
+ 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() {}
« no previous file with comments | « ui/keyboard/keyboard_controller_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698