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

Unified Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 2871243003: Enable new-virtual-keyboard-behavior flag by default. (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: ash/wm/workspace/workspace_layout_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index 5ef8fe99d7b78012986b67cb051f4a26b1ca65db..b5ace408f29585702b01bc375cf711fa79b7844d 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -103,6 +103,12 @@ display::Display GetDisplayNearestWindow(aura::Window* window) {
return display::Screen::GetScreen()->GetDisplayNearestWindow(window);
}
+void DisableNewVKMode() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(::switches::kDisableNewVirtualKeyboardBehavior))
oshima 2017/05/16 12:31:30 you can just add it
yhanada 2017/05/17 01:33:37 Done.
+ command_line->AppendSwitch(::switches::kDisableNewVirtualKeyboardBehavior);
+}
+
} // namespace
using WorkspaceLayoutManagerTest = test::AshTestBase;
@@ -1156,12 +1162,6 @@ class WorkspaceLayoutManagerKeyboardTest : public test::AshTestBase {
work_area.width(), work_area.height() / 2);
}
- void EnableNewVKMode() {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (!command_line->HasSwitch(::switches::kUseNewVirtualKeyboardBehavior))
- command_line->AppendSwitch(::switches::kUseNewVirtualKeyboardBehavior);
- }
-
const gfx::Rect& keyboard_bounds() const { return keyboard_bounds_; }
private:
@@ -1175,6 +1175,9 @@ class WorkspaceLayoutManagerKeyboardTest : public test::AshTestBase {
// Tests that when a child window gains focus the top level window containing it
// is resized to fit the remaining workspace area.
TEST_F(WorkspaceLayoutManagerKeyboardTest, ChildWindowFocused) {
+ // Append the flag to cause work area change in non-sticky mode.
+ DisableNewVKMode();
+
// See comment at top of file for why this is needed.
WmWindowTestApi::GlobalMinimumSizeLock min_size_lock;
@@ -1207,6 +1210,9 @@ TEST_F(WorkspaceLayoutManagerKeyboardTest, ChildWindowFocused) {
}
TEST_F(WorkspaceLayoutManagerKeyboardTest, AdjustWindowForA11yKeyboard) {
+ // Append the flag to cause work area change in non-sticky mode.
+ DisableNewVKMode();
+
// See comment at top of file for why this is needed.
WmWindowTestApi::GlobalMinimumSizeLock min_size_lock;
InitKeyboardBounds();
@@ -1259,6 +1265,8 @@ TEST_F(WorkspaceLayoutManagerKeyboardTest, AdjustWindowForA11yKeyboard) {
}
TEST_F(WorkspaceLayoutManagerKeyboardTest, IgnoreKeyboardBoundsChange) {
+ // Append the flag to cause work area change in non-sticky mode.
+ DisableNewVKMode();
InitKeyboardBounds();
std::unique_ptr<aura::Window> window(CreateTestWindow(keyboard_bounds()));

Powered by Google App Engine
This is Rietveld 408576698