[iOS][PasswordCheckup] Disable failing tests on device

Bug: 343389608
Change-Id: I85f27f2c3c3d8198b296c9c71eaf15d8f23563e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577023
Commit-Queue: Christian Xu <christianxu@chromium.org>
Reviewed-by: Ewann Pellé <ewannpv@chromium.org>
Auto-Submit: Christian Xu <christianxu@chromium.org>
Owners-Override: Christian Xu <christianxu@chromium.org>
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1307370}
diff --git a/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_egtest.mm b/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_egtest.mm
index d3fd13a3..31e9d34 100644
--- a/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_egtest.mm
+++ b/ios/chrome/browser/ui/settings/password/password_checkup/password_checkup_egtest.mm
@@ -315,7 +315,15 @@
 #pragma mark - Tests
 
 // Tests the safe state of the Password Checkup Homepage.
-- (void)testPasswordCheckupHomepageSafeState {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupHomepageSafeState \
+  DISABLED_testPasswordCheckupHomepageSafeState
+#else
+#define MAYBE_testPasswordCheckupHomepageSafeState \
+  testPasswordCheckupHomepageSafeState
+#endif
+- (void)MAYBE_testPasswordCheckupHomepageSafeState {
   SavePasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(/*result_state=*/PasswordCheckStateSafe,
@@ -336,7 +344,15 @@
 
 // Validates that the Password Manager UI is dismissed when local authentication
 // fails while in the Password Checkup UI.
-- (void)testPasswordCheckupHomepageWithFailedAuth {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupHomepageWithFailedAuth \
+  DISABLED_testPasswordCheckupHomepageWithFailedAuth
+#else
+#define MAYBE_testPasswordCheckupHomepageWithFailedAuth \
+  testPasswordCheckupHomepageWithFailedAuth
+#endif
+- (void)MAYBE_testPasswordCheckupHomepageWithFailedAuth {
   SavePasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(/*result_state=*/PasswordCheckStateSafe,
@@ -369,7 +385,15 @@
 }
 
 // Tests the warning state of the Password Checkup Homepage.
-- (void)testPasswordCheckupHomepageWarningState {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupHomepageWarningState \
+  DISABLED_testPasswordCheckupHomepageWarningState
+#else
+#define MAYBE_testPasswordCheckupHomepageWarningState \
+  testPasswordCheckupHomepageWarningState
+#endif
+- (void)MAYBE_testPasswordCheckupHomepageWarningState {
   SaveMutedCompromisedPasswordFormToProfileStore();
   SaveReusedPasswordFormsToProfileStore();
   SaveWeakPasswordFormToProfileStore();
@@ -405,7 +429,15 @@
 }
 
 // Tests the severe warning state of the Password Checkup Homepage.
-- (void)testPasswordCheckupHomepageCompromisedState {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupHomepageCompromisedState \
+  DISABLED_testPasswordCheckupHomepageCompromisedState
+#else
+#define MAYBE_testPasswordCheckupHomepageCompromisedState \
+  testPasswordCheckupHomepageCompromisedState
+#endif
+- (void)MAYBE_testPasswordCheckupHomepageCompromisedState {
   SaveCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -475,7 +507,15 @@
 }
 
 // Tests the error state of the Password Checkup Homepage.
-- (void)testPasswordCheckupHomepageErrorState {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupHomepageErrorState \
+  DISABLED_testPasswordCheckupHomepageErrorState
+#else
+#define MAYBE_testPasswordCheckupHomepageErrorState \
+  testPasswordCheckupHomepageErrorState
+#endif
+- (void)MAYBE_testPasswordCheckupHomepageErrorState {
   SaveCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -510,7 +550,15 @@
 
 // Tests that the Password Checkup Homepage header image view is correctly
 // shown/hidden depending on the device's orientation.
-- (void)testPasswordCheckupHomepageDeviceOrientation {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupHomepageDeviceOrientation \
+  DISABLED_testPasswordCheckupHomepageDeviceOrientation
+#else
+#define MAYBE_testPasswordCheckupHomepageDeviceOrientation \
+  testPasswordCheckupHomepageDeviceOrientation
+#endif
+- (void)MAYBE_testPasswordCheckupHomepageDeviceOrientation {
   if ([ChromeEarlGrey isIPadIdiom]) {
     EARL_GREY_TEST_SKIPPED(@"Landscape orientation doesn't change the look of "
                            @"the Password Checkup Homepage.");
@@ -546,7 +594,15 @@
 }
 
 // Tests dismissing a compromised password warning.
-- (void)testPasswordCheckupDismissCompromisedPasswordWarning {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupDismissCompromisedPasswordWarning \
+  DISABLED_testPasswordCheckupDismissCompromisedPasswordWarning
+#else
+#define MAYBE_testPasswordCheckupDismissCompromisedPasswordWarning \
+  testPasswordCheckupDismissCompromisedPasswordWarning
+#endif
+- (void)MAYBE_testPasswordCheckupDismissCompromisedPasswordWarning {
   SaveCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -605,7 +661,15 @@
 }
 
 // Tests restoring a muted compromised password warning.
-- (void)testPasswordCheckupRestoreCompromisedPasswordWarning {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupRestoreCompromisedPasswordWarning \
+  DISABLED_testPasswordCheckupRestoreCompromisedPasswordWarning
+#else
+#define MAYBE_testPasswordCheckupRestoreCompromisedPasswordWarning \
+  testPasswordCheckupRestoreCompromisedPasswordWarning
+#endif
+- (void)MAYBE_testPasswordCheckupRestoreCompromisedPasswordWarning {
   SaveMutedCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -664,7 +728,13 @@
 }
 
 // Tests deleting the last saved password through Password Checkup.
-- (void)testDeleteLastPassword {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testDeleteLastPassword DISABLED_testDeleteLastPassword
+#else
+#define MAYBE_testDeleteLastPassword testDeleteLastPassword
+#endif
+- (void)MAYBE_testDeleteLastPassword {
   SaveCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -695,7 +765,15 @@
 
 // Tests resolving the last reused passwords issue by editing a password through
 // Password Checkup.
-- (void)testResolveLastIssueByEditingPassword {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testResolveLastIssueByEditingPassword \
+  DISABLED_testResolveLastIssueByEditingPassword
+#else
+#define MAYBE_testResolveLastIssueByEditingPassword \
+  testResolveLastIssueByEditingPassword
+#endif
+- (void)MAYBE_testResolveLastIssueByEditingPassword {
   SaveReusedPasswordFormsToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -731,7 +809,15 @@
 
 // Tests resolving the last compromised passwords issue by deleting a password
 // through Password Checkup.
-- (void)testResolveLastIssueByDeletingPassword {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testResolveLastIssueByDeletingPassword \
+  DISABLED_testResolveLastIssueByDeletingPassword
+#else
+#define MAYBE_testResolveLastIssueByDeletingPassword \
+  testResolveLastIssueByDeletingPassword
+#endif
+- (void)MAYBE_testResolveLastIssueByDeletingPassword {
   SavePasswordFormToProfileStore(kSafePassword, kDefaultUsername, kSite1);
   SaveCompromisedPasswordFormToProfileStore();
 
@@ -768,7 +854,15 @@
 
 // Tests resolving the last compromised passwords issue by deleting a password
 // through Password Checkup.
-- (void)testChangeCompromisedPasswordToSafePassword {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testChangeCompromisedPasswordToSafePassword \
+  DISABLED_testChangeCompromisedPasswordToSafePassword
+#else
+#define MAYBE_testChangeCompromisedPasswordToSafePassword \
+  testChangeCompromisedPasswordToSafePassword
+#endif
+- (void)MAYBE_testChangeCompromisedPasswordToSafePassword {
   SaveCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -804,7 +898,15 @@
 
 // Tests changing the password of a muted compromised password to a weak
 // password.
-- (void)testChangeMutedPasswordToWeakPassword {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testChangeMutedPasswordToWeakPassword \
+  DISABLED_testChangeMutedPasswordToWeakPassword
+#else
+#define MAYBE_testChangeMutedPasswordToWeakPassword \
+  testChangeMutedPasswordToWeakPassword
+#endif
+- (void)MAYBE_testChangeMutedPasswordToWeakPassword {
   SaveMutedCompromisedPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -865,7 +967,15 @@
 
 // Tests the details page of a credential that is both weak and compromised when
 // opened from the weak issues page.
-- (void)testCompromisedAndWeakPasswordOpenedInWeakContext {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testCompromisedAndWeakPasswordOpenedInWeakContext \
+  DISABLED_testCompromisedAndWeakPasswordOpenedInWeakContext
+#else
+#define MAYBE_testCompromisedAndWeakPasswordOpenedInWeakContext \
+  testCompromisedAndWeakPasswordOpenedInWeakContext
+#endif
+- (void)MAYBE_testCompromisedAndWeakPasswordOpenedInWeakContext {
   SaveCompromisedPasswordFormToProfileStore(kWeakPassword);
 
   OpenPasswordCheckupHomepage(
@@ -891,7 +1001,15 @@
 
 // Tests the details page of a credential that is both reused and compromised
 // when opened from the reused issues page.
-- (void)testCompromisedAndReusedPasswordOpenedInReusedContext {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testCompromisedAndReusedPasswordOpenedInReusedContext \
+  DISABLED_testCompromisedAndReusedPasswordOpenedInReusedContext
+#else
+#define MAYBE_testCompromisedAndReusedPasswordOpenedInReusedContext \
+  testCompromisedAndReusedPasswordOpenedInReusedContext
+#endif
+- (void)MAYBE_testCompromisedAndReusedPasswordOpenedInReusedContext {
   SaveCompromisedPasswordFormToProfileStore(kReusedPassword);
   SaveReusedPasswordFormsToProfileStore();
 
@@ -918,7 +1036,15 @@
 
 // Tests that Password Checkup Homepage is dismissed when there are no saved
 // passwords.
-- (void)testPasswordCheckupDismissedAfterAllPasswordsGone {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordCheckupDismissedAfterAllPasswordsGone \
+  DISABLED_testPasswordCheckupDismissedAfterAllPasswordsGone
+#else
+#define MAYBE_testPasswordCheckupDismissedAfterAllPasswordsGone \
+  testPasswordCheckupDismissedAfterAllPasswordsGone
+#endif
+- (void)MAYBE_testPasswordCheckupDismissedAfterAllPasswordsGone {
   SavePasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(
@@ -936,7 +1062,14 @@
 
 // Validates that the Password Manager UI is dismissed when local authentication
 // fails while in the Password Issues UI.
-- (void)testPasswordIssuesWithFailedAuth {
+// TODO(crbug.com/343389608): Test fails on device.
+#if !TARGET_IPHONE_SIMULATOR
+#define MAYBE_testPasswordIssuesWithFailedAuth \
+  DISABLED_testPasswordIssuesWithFailedAuth
+#else
+#define MAYBE_testPasswordIssuesWithFailedAuth testPasswordIssuesWithFailedAuth
+#endif
+- (void)MAYBE_testPasswordIssuesWithFailedAuth {
   SaveWeakPasswordFormToProfileStore();
 
   OpenPasswordCheckupHomepage(