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

Side by Side Diff: ios/chrome/browser/ui/settings/passwords_settings_egtest.mm

Issue 2860453004: Fix PasswordsSettingsTestCase.testCopyPasswordToast (Closed)
Patch Set: Fix PasswordsSettingsTestCase.testCopyPasswordToast 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/callback.h" 5 #include "base/callback.h"
6 #include "base/mac/foundation_util.h" 6 #include "base/mac/foundation_util.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "components/autofill/core/common/password_form.h" 10 #include "components/autofill/core/common/password_form.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 chrome_test_util::VerifyAccessibilityForCurrentScreen(); 332 chrome_test_util::VerifyAccessibilityForCurrentScreen();
333 [self tapBackArrow]; 333 [self tapBackArrow];
334 334
335 [self tapBackArrow]; 335 [self tapBackArrow];
336 [self tapDone]; 336 [self tapDone];
337 [self clearPasswordStore]; 337 [self clearPasswordStore];
338 } 338 }
339 339
340 // Checks that attempts to copy a password provide appropriate feedback, 340 // Checks that attempts to copy a password provide appropriate feedback,
341 // both when reauthentication succeeds and when it fails. 341 // both when reauthentication succeeds and when it fails.
342 // TODO(crbug.com/718043): Re-enable test. 342 - (void)testCopyPasswordToast {
343 - (void)DISABLED_testCopyPasswordToast {
344 [self scopedEnablePasswordManagementAndViewingUI]; 343 [self scopedEnablePasswordManagementAndViewingUI];
345 344
346 // Saving a form is needed for using the "password details" view. 345 // Saving a form is needed for using the "password details" view.
347 [self saveExamplePasswordForm]; 346 [self saveExamplePasswordForm];
348 347
349 [self openPasswordSettings]; 348 [self openPasswordSettings];
350 349
351 [[EarlGrey selectElementWithMatcher:Entry(@"https://example.com, user")] 350 [[EarlGrey selectElementWithMatcher:Entry(@"https://example.com, user")]
352 performAction:grey_tap()]; 351 performAction:grey_tap()];
353 352
(...skipping 12 matching lines...) Expand all
366 [password_details_collection_view_controller 365 [password_details_collection_view_controller
367 setReauthenticationModule:mock_reauthentication_module]; 366 setReauthenticationModule:mock_reauthentication_module];
368 367
369 // Check the snackbar in case of successful reauthentication. 368 // Check the snackbar in case of successful reauthentication.
370 mock_reauthentication_module.shouldSucceed = YES; 369 mock_reauthentication_module.shouldSucceed = YES;
371 [[EarlGrey selectElementWithMatcher:CopyPasswordButton()] 370 [[EarlGrey selectElementWithMatcher:CopyPasswordButton()]
372 performAction:grey_tap()]; 371 performAction:grey_tap()];
373 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; 372 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
374 NSString* snackbarLabel = 373 NSString* snackbarLabel =
375 l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_WAS_COPIED_MESSAGE); 374 l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_WAS_COPIED_MESSAGE);
375 // Tap the label instead of asserting that it is there, and wait until the
376 // tap causes it to close. Otherwise it will block the copy button for the
377 // rest of the test on small devices, and scrolling to reach the button
378 // won't work when the snackbar is up.
376 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)] 379 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
377 assertWithMatcher:grey_notNil()]; 380 performAction:grey_tap()];
381 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
baxley 2017/05/03 18:07:11 Does this guarantee that the snackbar is gone when
vabr (Chromium) 2017/05/03 20:32:26 I have good news. When I caused the fade-out anima
378 382
379 // Check the snackbar in case of failed reauthentication. 383 // Check the snackbar in case of failed reauthentication.
380 mock_reauthentication_module.shouldSucceed = NO; 384 mock_reauthentication_module.shouldSucceed = NO;
381 [[EarlGrey selectElementWithMatcher:CopyPasswordButton()] 385 [[EarlGrey selectElementWithMatcher:CopyPasswordButton()]
382 performAction:grey_tap()]; 386 performAction:grey_tap()];
383 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; 387 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
384 snackbarLabel = 388 snackbarLabel =
385 l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_WAS_NOT_COPIED_MESSAGE); 389 l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_WAS_NOT_COPIED_MESSAGE);
386 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)] 390 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
387 assertWithMatcher:grey_notNil()]; 391 assertWithMatcher:grey_notNil()];
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)] 444 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(snackbarLabel)]
441 assertWithMatcher:grey_notNil()]; 445 assertWithMatcher:grey_notNil()];
442 446
443 [self tapBackArrow]; 447 [self tapBackArrow];
444 [self tapBackArrow]; 448 [self tapBackArrow];
445 [self tapDone]; 449 [self tapDone];
446 [self clearPasswordStore]; 450 [self clearPasswordStore];
447 } 451 }
448 452
449 @end 453 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698