Commit cb636760 authored by David Jean's avatar David Jean Committed by Commit Bot

[ios] Disable keyboard splitting/undocking tests on iPad Pro

There's no easy or solid way to detect iPad Pro
(especially in simulator) so I just dynamically DISABLE
the test is the code fails to undock and split.

Bug: 987204
Change-Id: Id65881af22cb05af9c5787fd99cb3b40a11065d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715270Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Commit-Queue: David Jean <djean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680399}
parent 49d46905
...@@ -178,10 +178,11 @@ BOOL IsKeyboardDockedForLayout(UIView* layout) { ...@@ -178,10 +178,11 @@ BOOL IsKeyboardDockedForLayout(UIView* layout) {
// Undocks and split the keyboard by swiping it up. Does nothing if already // Undocks and split the keyboard by swiping it up. Does nothing if already
// undocked. Only works on iOS 12; it is an error to call this method on // undocked. Only works on iOS 12; it is an error to call this method on
// iOS 13. // iOS 13. Some devices, like iPhone or iPad Pro, do not allow undocking or
void UndockAndSplitKeyboard() { // splitting, this returns NO if it is the case.
BOOL UndockAndSplitKeyboard() {
if (![ChromeEarlGrey isIPadIdiom]) { if (![ChromeEarlGrey isIPadIdiom]) {
return; return NO;
} }
// TODO(crbug.com/985977): Remove this DCHECK once this method is updated to // TODO(crbug.com/985977): Remove this DCHECK once this method is updated to
...@@ -200,7 +201,7 @@ void UndockAndSplitKeyboard() { ...@@ -200,7 +201,7 @@ void UndockAndSplitKeyboard() {
if (!IsKeyboardDockedForLayout(layout)) { if (!IsKeyboardDockedForLayout(layout)) {
// If we created a dummy textfield for this, remove it. // If we created a dummy textfield for this, remove it.
[textField removeFromSuperview]; [textField removeFromSuperview];
return; return YES;
} }
// Swipe it up. // Swipe it up.
...@@ -225,8 +226,7 @@ void UndockAndSplitKeyboard() { ...@@ -225,8 +226,7 @@ void UndockAndSplitKeyboard() {
kGREYDirectionUp, startPoint.x, startPoint.y); kGREYDirectionUp, startPoint.x, startPoint.y);
[[EarlGrey selectElementWithMatcher:matcher] performAction:action]; [[EarlGrey selectElementWithMatcher:matcher] performAction:action];
GREYAssertTrue(!IsKeyboardDockedForLayout(layout), return !IsKeyboardDockedForLayout(layout);
@"Keyboard should be undocked");
} }
// Docks the keyboard by swiping it down. Does nothing if already docked. Only // Docks the keyboard by swiping it down. Does nothing if already docked. Only
...@@ -539,7 +539,10 @@ void DockKeyboard() { ...@@ -539,7 +539,10 @@ void DockKeyboard() {
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:chrome_test_util::TapWebElement(kFormElementCity)]; performAction:chrome_test_util::TapWebElement(kFormElementCity)];
UndockAndSplitKeyboard(); if (!UndockAndSplitKeyboard()) {
EARL_GREY_TEST_DISABLED(
@"Undocking the keyboard does not work on iPhone or iPad Pro");
}
// When keyboard is split, icons are not visible, so we rely on timeout before // When keyboard is split, icons are not visible, so we rely on timeout before
// docking again, because EarlGrey synchronization isn't working properly with // docking again, because EarlGrey synchronization isn't working properly with
...@@ -607,7 +610,10 @@ void DockKeyboard() { ...@@ -607,7 +610,10 @@ void DockKeyboard() {
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:chrome_test_util::TapWebElement(kFormElementCity)]; performAction:chrome_test_util::TapWebElement(kFormElementCity)];
UndockAndSplitKeyboard(); if (!UndockAndSplitKeyboard()) {
EARL_GREY_TEST_DISABLED(
@"Undocking the keyboard does not work on iPhone or iPad Pro");
}
// When keyboard is split, icons are not visible, so we rely on timeout before // When keyboard is split, icons are not visible, so we rely on timeout before
// docking again, because EarlGrey synchronization isn't working properly with // docking again, because EarlGrey synchronization isn't working properly with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment