[ios] Fixes PasswordSettingsTestCase.testExportFlow on iOS13 iPad.

BUG=983143

Change-Id: I7d0a681115bf9b2dce6a4fb4c3ea7d501ede9f6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709935
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679164}
diff --git a/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm b/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm
index 219ef0e..3adc5ad 100644
--- a/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/password/passwords_settings_egtest.mm
@@ -1521,15 +1521,16 @@
   // Wait until the alerts are dismissed.
   [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
 
-  // On iOS 13+ when building with the iOS 12 SDK, the share sheet is presented
-  // fullscreen, so the export button is removed from the view hierarchy.  Check
-  // that the button is not present.  Otherwise, the export button should remain
-  // visible but be disabled.
+  // On iOS 13+ phone when building with the iOS 12 SDK, the share sheet is
+  // presented fullscreen, so the export button is removed from the view
+  // hierarchy.  Check that either the button is not present, or that it remains
+  // visible but is disabled.
   id<GREYMatcher> exportButtonStatusMatcher =
       grey_accessibilityTrait(UIAccessibilityTraitNotEnabled);
 #if !defined(__IPHONE_13_0) || (__IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_13_0)
   if (base::ios::IsRunningOnIOS13OrLater()) {
-    exportButtonStatusMatcher = grey_nil();
+    exportButtonStatusMatcher =
+        grey_anyOf(grey_nil(), exportButtonStatusMatcher, nil);
   }
 #endif