Commit 3edb7dbb authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Enable Earl Grey 1 and 2 tests for ClearSyncedData feature.

Previously the test case testSignOutAndClearDataFromNonManagedAccountClearsData() was disabled due to a misuse of the ScopedFeatureList flag, which should only be used for unit tests. This meant that the flag was not set correctly in the tests.

The change uses the AppLaunchManager to enable the experimental flag on Earl Grey 2 and the flag within the Earl Grey 1 JSON setup.

Bug: 1045981
Change-Id: I3160477a5230d24617168800a5cabacb4b8fd672
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2023835Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737283}
parent 3fc8b508
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
}, },
{ {
"app": "ios_chrome_settings_egtests", "app": "ios_chrome_settings_egtests",
"test args": [
"--enable-features=ClearSyncedData"
],
"xcode parallelization": true, "xcode parallelization": true,
"shards": 1, "shards": 1,
"swarming tasks": 3 "swarming tasks": 3
......
...@@ -49,9 +49,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -49,9 +49,7 @@ id<GREYMatcher> NoBookmarksLabel() {
@interface AccountCollectionsTestCase : ChromeTestCase @interface AccountCollectionsTestCase : ChromeTestCase
@end @end
@implementation AccountCollectionsTestCase { @implementation AccountCollectionsTestCase
base::test::ScopedFeatureList _featureList;
}
- (void)tearDown { - (void)tearDown {
[ChromeEarlGrey waitForBookmarksToFinishLoading]; [ChromeEarlGrey waitForBookmarksToFinishLoading];
...@@ -62,9 +60,14 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -62,9 +60,14 @@ id<GREYMatcher> NoBookmarksLabel() {
[super tearDown]; [super tearDown];
} }
- (void)setUp { - (void)launchAppForTestMethod {
_featureList.InitAndEnableFeature(kClearSyncedData); [[AppLaunchManager sharedManager]
ensureAppLaunchedWithFeaturesEnabled:{kClearSyncedData}
disabled:{}
relaunchPolicy:NoForceRelaunchAndResetState];
}
- (void)setUp {
[super setUp]; [super setUp];
[ChromeEarlGrey waitForBookmarksToFinishLoading]; [ChromeEarlGrey waitForBookmarksToFinishLoading];
...@@ -205,8 +208,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -205,8 +208,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that selecting sign-out and clear data from a non-managed user account // Tests that selecting sign-out and clear data from a non-managed user account
// clears the user's synced data. // clears the user's synced data.
// TODO(crbug.com/1045981): Fix and enable. - (void)testSignOutAndClearDataFromNonManagedAccountClearsData {
- (void)DISABLED_testSignOutAndClearDataFromNonManagedAccountClearsData {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1];
// Sign In |fakeIdentity|. // Sign In |fakeIdentity|.
......
...@@ -917,7 +917,9 @@ ...@@ -917,7 +917,9 @@
"type": "raw", "type": "raw",
}, },
"ios_chrome_settings_egtests": { "ios_chrome_settings_egtests": {
"args": [], "args": [
"--enable-features=ClearSyncedData",
],
"label": "//ios/chrome/test/earl_grey:ios_chrome_settings_egtests", "label": "//ios/chrome/test/earl_grey:ios_chrome_settings_egtests",
"type": "raw", "type": "raw",
}, },
......
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