0

Revert "[ios] Add EG test to chrome://management page"

This reverts commit 46c6817bcc.

Reason for revert: Chromium upsteam Egtest failing
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8868162076936730176/+/steps/ios_chrome_integration_eg2tests_module_iPhone_6s_13.6_on_Mac-10.15/0/stdout

[12:20:39:INFO]  Interaction cannot continue because the desired element was not found.
[12:20:39:INFO] 
[12:20:39:INFO] Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches the element.
[12:20:39:INFO] 
[12:20:39:INFO] Element Matcher:
[12:20:39:INFO] Omnibox contains text 'support.google.com'

Original change's description:
> [ios] Add EG test to chrome://management page
>
> Added EG test to chrome://management page.
>
> Updated omniboxContainingText: matcher to avoid crash when the
> element is not an UITextField.
>
> Bug: 1131052
> Change-Id: Ia68ad5a6071867e8ae3cf4751ce1ef792cd741dd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424546
> Reviewed-by: Gauthier Ambard <gambard@chromium.org>
> Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
> Reviewed-by: Sergio Collazos <sczs@chromium.org>
> Commit-Queue: Tina Wang <tinazwang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#810645}

TBR=michaeldo@chromium.org,sczs@chromium.org,gambard@chromium.org,tinazwang@chromium.org

Change-Id: I3ca8a0e6d189ec6c8045439abc6b76c8bbaafb6d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1131052
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432316
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810764}
This commit is contained in:
Chris Lu
2020-09-25 20:39:10 +00:00
committed by Commit Bot
parent 4c3be7eb07
commit 94309cdc08
3 changed files with 3 additions and 35 deletions
components/management/resources
ios/chrome

@ -31,7 +31,7 @@
<div id="managed-info" class="hidden">
<div id="main-message">$i18n{managementMessage}</div>
<div id="secondary-message">$i18n{managedInfo}
<a id="learn-more-link" target="_blank" href=$i18n{learnMoreURL}>$i18n{learnMore}</a>
<a target="_blank" href=$i18n{learnMoreURL}>$i18n{learnMore}</a>
</div>
</div>
<div id="unmanaged-info" class="hidden">$i18n{unmanagedInfo}</div>

@ -249,34 +249,4 @@ id<GREYMatcher> ToolsMenuTranslateButton() {
assertWithMatcher:grey_notNil()];
}
// Test the chrome://management page when no machine level policy is set.
- (void)testManagementPageUnmanaged {
// Open the management page and check if the content is expected.
[ChromeEarlGrey loadURL:GURL("chrome://management")];
[ChromeEarlGrey
waitForWebStateContainingText:l10n_util::GetStringUTF8(
IDS_IOS_MANAGEMENT_UI_UNMANAGED_DESC)];
}
// Test the chrome://management page when one or more machine level policies are
// set.
- (void)testManagementPageManaged {
// Setup a machine level policy.
SetPolicy(false, policy::key::kTranslateEnabled);
// Open the management page and check if the content is expected.
[ChromeEarlGrey loadURL:GURL("chrome://management")];
[ChromeEarlGrey
waitForWebStateContainingText:l10n_util::GetStringUTF8(
IDS_IOS_MANAGEMENT_UI_MESSAGE)];
// Open the "learn more" link in the web content.
[ChromeEarlGrey tapWebStateElementWithID:@"learn-more-link"];
[ChromeEarlGrey waitForPageToFinishLoading];
// Check the navigation.
[[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxContainingText(
"support.google.com")]
assertWithMatcher:grey_notNil()];
}
@end

@ -309,10 +309,8 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
+ (id<GREYMatcher>)omniboxContainingText:(NSString*)text {
GREYElementMatcherBlock* matcher = [GREYElementMatcherBlock
matcherWithMatchesBlock:^BOOL(id element) {
OmniboxTextFieldIOS* omnibox =
base::mac::ObjCCast<OmniboxTextFieldIOS>(element);
return [omnibox.text containsString:text];
matcherWithMatchesBlock:^BOOL(UITextField* element) {
return [element.text containsString:text];
}
descriptionBlock:^void(id<GREYDescription> description) {
[description