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

Unified Diff: ash/virtual_keyboard_controller_unittest.cc

Issue 2905383003: (fix landed) Reland of name MaximizeMode to TabletMode (Closed)
Patch Set: 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
« no previous file with comments | « ash/virtual_keyboard_controller.cc ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/virtual_keyboard_controller_unittest.cc
diff --git a/ash/virtual_keyboard_controller_unittest.cc b/ash/virtual_keyboard_controller_unittest.cc
index 3956022a80b3fee3bf40763059ba45a10328fa4d..220a14447db204a8a1fb31584d439965f95fba61 100644
--- a/ash/virtual_keyboard_controller_unittest.cc
+++ b/ash/virtual_keyboard_controller_unittest.cc
@@ -11,8 +11,8 @@
#include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/virtual_keyboard/virtual_keyboard_observer.h"
#include "ash/test/ash_test_base.h"
-#include "ash/wm/maximize_mode/maximize_mode_controller.h"
-#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h"
+#include "ash/wm/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h"
+#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "base/command_line.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/device_hotplug_event_observer.h"
@@ -46,8 +46,7 @@
// Sets the event blocker on the maximized window controller.
void SetEventBlocker(
std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> blocker) {
- Shell::Get()->maximize_mode_controller()->event_blocker_ =
- std::move(blocker);
+ Shell::Get()->tablet_mode_controller()->event_blocker_ = std::move(blocker);
}
void SetUp() override {
@@ -81,9 +80,8 @@
// Tests that reenabling keyboard devices while shutting down does not
// cause the Virtual Keyboard Controller to crash. See crbug.com/446204.
TEST_F(VirtualKeyboardControllerTest, RestoreKeyboardDevices) {
- // Toggle maximized mode on.
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
+ // Toggle tablet mode on.
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> blocker(
new MockEventBlocker);
SetEventBlocker(std::move(blocker));
@@ -134,7 +132,7 @@
};
// Tests that the onscreen keyboard is disabled if an internal keyboard is
-// present and maximized mode is disabled.
+// present and tablet mode is disabled.
TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
std::vector<ui::TouchscreenDevice> screens;
screens.push_back(
@@ -214,8 +212,8 @@
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
}
-// Tests maximized mode interaction without disabling the internal keyboard.
-TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringMaximizeMode) {
+// Tests tablet mode interaction without disabling the internal keyboard.
+TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringTabletMode) {
std::vector<ui::TouchscreenDevice> screens;
screens.push_back(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
@@ -226,17 +224,15 @@
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
UpdateKeyboardDevices(keyboard_devices);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
- // Toggle maximized mode on.
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
- ASSERT_TRUE(keyboard::IsKeyboardEnabled());
- // Toggle maximized mode off.
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- false);
- ASSERT_FALSE(keyboard::IsKeyboardEnabled());
-}
-
-// Tests that keyboard gets suppressed in maximized mode.
+ // Toggle tablet mode on.
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+ ASSERT_TRUE(keyboard::IsKeyboardEnabled());
+ // Toggle tablet mode off.
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ ASSERT_FALSE(keyboard::IsKeyboardEnabled());
+}
+
+// Tests that keyboard gets suppressed in tablet mode.
TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) {
std::vector<ui::TouchscreenDevice> screens;
screens.push_back(
@@ -249,9 +245,8 @@
keyboard_devices.push_back(ui::InputDevice(
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "Keyboard"));
UpdateKeyboardDevices(keyboard_devices);
- // Toggle maximized mode on.
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- true);
+ // Toggle tablet mode on.
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
@@ -275,9 +270,8 @@
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
- // Toggle maximized mode oFF.
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
- false);
+ // Toggle tablet mode oFF.
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
}
« no previous file with comments | « ash/virtual_keyboard_controller.cc ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698