Commit 3304cfee authored by vabr's avatar vabr Committed by Commit bot

Add EGTests for passwords settings on iOS

This adds a basic integration test for saving on a test page, and also a test
for copy-password confirmation toast, which is not coverable by the unittests (yet).

BUG=159166

Review-Url: https://codereview.chromium.org/2846253002
Cr-Commit-Position: refs/heads/master@{#468910}
parent cb129c01
......@@ -309,6 +309,7 @@ source_set("test_support") {
sources = [
"passphrase_collection_view_controller_test.h",
"passphrase_collection_view_controller_test.mm",
"password_details_collection_view_controller_for_testing.h",
"personal_data_manager_data_changed_observer.cc",
"personal_data_manager_data_changed_observer.h",
]
......@@ -445,6 +446,7 @@ source_set("eg_tests") {
"autofill_settings_egtest.mm",
"block_popups_egtest.mm",
"clear_browsing_data_egtest.mm",
"passwords_settings_egtest.mm",
"settings_egtest.mm",
"translate_ui_egtest.mm",
]
......@@ -452,9 +454,12 @@ source_set("eg_tests") {
deps = [
":settings",
"//base",
"//components/autofill/core/common",
"//components/browsing_data/core",
"//components/content_settings/core/browser",
"//components/keyed_service/core",
"//components/metrics",
"//components/password_manager/core/browser",
"//components/password_manager/core/common",
"//components/prefs",
"//components/search_engines",
......@@ -466,10 +471,13 @@ source_set("eg_tests") {
"//ios/chrome/browser",
"//ios/chrome/browser/browser_state",
"//ios/chrome/browser/content_settings",
"//ios/chrome/browser/passwords:passwords",
"//ios/chrome/browser/search_engines",
"//ios/chrome/browser/signin",
"//ios/chrome/browser/ui:ui_internal",
"//ios/chrome/browser/ui/settings:test_support",
"//ios/chrome/browser/ui/tools_menu",
"//ios/chrome/browser/ui/util:util",
"//ios/chrome/test/app:test_support",
"//ios/chrome/test/earl_grey:test_support",
"//ios/public/provider/chrome/browser/signin:test_support",
......
......@@ -293,6 +293,8 @@ reauthenticationModule:(id<ReauthenticationProtocol>)reauthenticationModule
}
- (void)showCopyPasswordResultToast:(NSString*)message {
// TODO(crbug.com/159166): Route this through some delegate API to be able
// to mock it in the unittest, and avoid having an EGTest just for that?
MDCSnackbarMessage* copyPasswordResultMessage =
[MDCSnackbarMessage messageWithText:message];
[MDCSnackbarManager showMessage:copyPasswordResultMessage];
......@@ -345,4 +347,11 @@ reauthenticationModule:(id<ReauthenticationProtocol>)reauthenticationModule
}
}
#pragma mark - ForTesting
- (void)setReauthenticationModule:
(id<ReauthenticationProtocol>)reauthenticationModule {
_weakReauthenticationModule = reauthenticationModule;
}
@end
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_DETAILS_COLLECTION_VIEW_CONTROLLER_FOR_TESTING_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_DETAILS_COLLECTION_VIEW_CONTROLLER_FOR_TESTING_H_
#import "ios/chrome/browser/ui/settings/password_details_collection_view_controller.h"
@interface PasswordDetailsCollectionViewController (ForTesting)
// Allows to replace a |reauthenticationModule| for a fake one in integration
// tests, where the testing code cannot control the creation of the
// controller.
- (void)setReauthenticationModule:
(id<ReauthenticationProtocol>)reauthenticationModule;
@end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_DETAILS_COLLECTION_VIEW_CONTROLLER_FOR_TESTING_H_
This diff is collapsed.
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