Commit 4489ae91 authored by Guillaume Jenkins's avatar Guillaume Jenkins Committed by Commit Bot

[iOS Policy] Improve chrome://policy EG test checks

Some existing policy tests load the chrome://policy page and ensure that
it loaded correctly by checking for the checkbox label at the top of the
page. This doesn't help catch Web UI issues that happen when displaying
the policy table further down the page.

This CL changes the selector so it looks for the policy table header,
which should help catch more WebUI problems in the future.

Bug: 1147191
Change-Id: Ib6c0a7c13d689d12f62eca5c88873bb31e749891
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2530173Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Commit-Queue: Guillaume Jenkins <gujen@google.com>
Cr-Commit-Position: refs/heads/master@{#826328}
parent 3299af0d
...@@ -89,7 +89,7 @@ void VerifyBoolPolicy(const std::string& policy_key, ...@@ -89,7 +89,7 @@ void VerifyBoolPolicy(const std::string& policy_key,
// provides some visual feedback as the test runs. // provides some visual feedback as the test runs.
[ChromeEarlGrey loadURL:GURL("chrome://policy")]; [ChromeEarlGrey loadURL:GURL("chrome://policy")];
[ChromeEarlGrey waitForWebStateContainingText:l10n_util::GetStringUTF8( [ChromeEarlGrey waitForWebStateContainingText:l10n_util::GetStringUTF8(
IDS_POLICY_SHOW_UNSET)]; IDS_POLICY_HEADER_NAME)];
// Force the preference off via policy. // Force the preference off via policy.
SetPolicy(false, policy_key); SetPolicy(false, policy_key);
GREYAssertFalse([ChromeEarlGrey userBooleanPref:pref_name], GREYAssertFalse([ChromeEarlGrey userBooleanPref:pref_name],
...@@ -159,7 +159,7 @@ void VerifyManagedSettingItem(NSString* accessibilityID, ...@@ -159,7 +159,7 @@ void VerifyManagedSettingItem(NSString* accessibilityID,
- (void)testAboutPolicy { - (void)testAboutPolicy {
[ChromeEarlGrey loadURL:GURL("chrome://policy")]; [ChromeEarlGrey loadURL:GURL("chrome://policy")];
[ChromeEarlGrey waitForWebStateContainingText:l10n_util::GetStringUTF8( [ChromeEarlGrey waitForWebStateContainingText:l10n_util::GetStringUTF8(
IDS_POLICY_SHOW_UNSET)]; IDS_POLICY_HEADER_NAME)];
} }
// Tests for the DefaultSearchProviderEnabled policy. // Tests for the DefaultSearchProviderEnabled policy.
......
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