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

Unified Diff: ash/virtual_keyboard_controller_unittest.cc

Issue 2909763002: Revert of Rename 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 220a14447db204a8a1fb31584d439965f95fba61..3956022a80b3fee3bf40763059ba45a10328fa4d 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/tablet_mode/scoped_disable_internal_mouse_and_keyboard.h"
-#include "ash/wm/tablet_mode/tablet_mode_controller.h"
+#include "ash/wm/maximize_mode/maximize_mode_controller.h"
+#include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h"
#include "base/command_line.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/device_hotplug_event_observer.h"
@@ -46,7 +46,8 @@
// Sets the event blocker on the maximized window controller.
void SetEventBlocker(
std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> blocker) {
- Shell::Get()->tablet_mode_controller()->event_blocker_ = std::move(blocker);
+ Shell::Get()->maximize_mode_controller()->event_blocker_ =
+ std::move(blocker);
}
void SetUp() override {
@@ -80,8 +81,9 @@
// 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 tablet mode on.
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+ // Toggle maximized mode on.
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> blocker(
new MockEventBlocker);
SetEventBlocker(std::move(blocker));
@@ -132,7 +134,7 @@
};
// Tests that the onscreen keyboard is disabled if an internal keyboard is
-// present and tablet mode is disabled.
+// present and maximized mode is disabled.
TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
std::vector<ui::TouchscreenDevice> screens;
screens.push_back(
@@ -212,8 +214,8 @@
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
}
-// Tests tablet mode interaction without disabling the internal keyboard.
-TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringTabletMode) {
+// Tests maximized mode interaction without disabling the internal keyboard.
+TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringMaximizeMode) {
std::vector<ui::TouchscreenDevice> screens;
screens.push_back(
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
@@ -224,15 +226,17 @@
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
UpdateKeyboardDevices(keyboard_devices);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
- // 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.
+ // 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.
TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) {
std::vector<ui::TouchscreenDevice> screens;
screens.push_back(
@@ -245,8 +249,9 @@
keyboard_devices.push_back(ui::InputDevice(
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "Keyboard"));
UpdateKeyboardDevices(keyboard_devices);
- // Toggle tablet mode on.
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+ // Toggle maximized mode on.
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_TRUE(IsVirtualKeyboardSuppressed());
@@ -270,8 +275,9 @@
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
- // Toggle tablet mode oFF.
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ // Toggle maximized mode oFF.
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ 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