Commit 0de4bd50 authored by zhaoyangli's avatar zhaoyangli Committed by Commit Bot

[iOS] Move ensureAppLaunchedWithFeaturesEnabled calls to proper place.

Moved ensureAppLaunchedWithFeaturesEnabled from -setUp to overriding
launchAppForTestMethod method of BaseEarlGreyTestCase. This will reduce
unnecessary relaunches of app, which will make tests suites run faster.

Bug: 1009017

Change-Id: I6f39404ae54e5a057ddba37867e08c45f27a9495
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928587Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Zhaoyang Li <zhaoyangli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719334}
parent d8f567c8
...@@ -105,14 +105,16 @@ BOOL WaitForKeyboardToAppear() { ...@@ -105,14 +105,16 @@ BOOL WaitForKeyboardToAppear() {
@implementation CreditCardViewControllerTestCase @implementation CreditCardViewControllerTestCase
- (void)setUp { - (void)launchAppForTestMethod {
[super setUp];
[[AppLaunchManager sharedManager] [[AppLaunchManager sharedManager]
ensureAppLaunchedWithFeaturesEnabled:{kSettingsAddPaymentMethod, ensureAppLaunchedWithFeaturesEnabled:{kSettingsAddPaymentMethod,
kCreditCardScanner} kCreditCardScanner}
disabled:{} disabled:{}
forceRestart:NO]; forceRestart:NO];
}
- (void)setUp {
[super setUp];
GREYAssertTrue(self.testServer->Start(), @"Test server failed to start."); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start.");
const GURL URL = self.testServer->GetURL(kFormHTMLFile); const GURL URL = self.testServer->GetURL(kFormHTMLFile);
[ChromeEarlGrey loadURL:URL]; [ChromeEarlGrey loadURL:URL];
......
...@@ -90,13 +90,16 @@ id<GREYMatcher> CardNumberIconView(NSString* icon_type) { ...@@ -90,13 +90,16 @@ id<GREYMatcher> CardNumberIconView(NSString* icon_type) {
@implementation AutofillAddCreditCardTestCase @implementation AutofillAddCreditCardTestCase
- (void)setUp { - (void)launchAppForTestMethod {
[super setUp];
[[AppLaunchManager sharedManager] [[AppLaunchManager sharedManager]
ensureAppLaunchedWithFeaturesEnabled:{kSettingsAddPaymentMethod, ensureAppLaunchedWithFeaturesEnabled:{kSettingsAddPaymentMethod,
kCreditCardScanner} kCreditCardScanner}
disabled:{} disabled:{}
forceRestart:NO]; forceRestart:NO];
}
- (void)setUp {
[super setUp];
GREYAssertTrue([ChromeEarlGrey isSettingsAddPaymentMethodEnabled], GREYAssertTrue([ChromeEarlGrey isSettingsAddPaymentMethodEnabled],
@"SettingsAddPaymentMethod should be enabled"); @"SettingsAddPaymentMethod should be enabled");
GREYAssertTrue([ChromeEarlGrey isCreditCardScannerEnabled], GREYAssertTrue([ChromeEarlGrey isCreditCardScannerEnabled],
......
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