Commit 64ecf553 authored by dalyk's avatar dalyk Committed by Commit Bot

Make some secure DNS setting tests interactive to fix flakiness.

Most tests involving the dropdown or custom input field have been moved
to the new secure_dns_interactive_test.js as they involve testing for
focus.

This cl also re-enables CrSettingsSecureDnsTest.All, which was disabled
when the flakiness was observed.

Bug: 1040145,1057504
Change-Id: I7813849295ddf6a3ddc283a9cdd9416db64b8f2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083760Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Katharine Daly <dalyk@google.com>
Cr-Commit-Position: refs/heads/master@{#746591}
parent b7f5172d
......@@ -22,7 +22,7 @@
<cr-input id="input" value="{{value}}"
placeholder="$i18n{secureDnsCustomPlaceholder}" invalid="[[showError_]]"
error-message="[[errorText_]]" maxlength="102400" spellcheck="false"
on-input="onInput_" on-blur="onBlur_">
on-input="onInput_" on-blur="validate">
</cr-input>
</template>
<script src="secure_dns_input.js"></script>
......
......@@ -51,9 +51,8 @@ Polymer({
* When the custom input field loses focus, validate the current value and
* trigger an event with the result. Show an error message if the validated
* value is still the most recent value, is invalid, and is non-empty.
* @private
*/
onBlur_: function() {
validate: function() {
const valueToValidate = this.value;
this.browserProxy_.validateCustomDnsEntry(valueToValidate).then(valid => {
this.showError_ =
......
......@@ -1025,8 +1025,7 @@ CrSettingsSecureDnsTest.prototype = {
]),
};
// Disabled due to flakiness: https://crbug.com/1057504.
TEST_F('CrSettingsSecureDnsTest', 'DISABLED_All', function() {
TEST_F('CrSettingsSecureDnsTest', 'All', function() {
mocha.run();
});
......
......@@ -72,3 +72,29 @@ CrSettingsAnimatedPagesTest.prototype = {
TEST_F('CrSettingsAnimatedPagesTest', 'All', function() {
mocha.run();
});
/**
* @constructor
* @extends {CrSettingsBrowserTest}
*/
function CrSettingsSecureDnsTest() {}
CrSettingsSecureDnsTest.prototype = {
__proto__: CrSettingsInteractiveUITest.prototype,
/** @override */
browsePreload: 'chrome://settings/privacy_page/secure_dns.html',
/** @override */
extraLibraries: CrSettingsInteractiveUITest.prototype.extraLibraries.concat([
'../test_util.js',
'../test_browser_proxy.js',
'test_privacy_page_browser_proxy.js',
'secure_dns_interactive_test.js',
]),
};
TEST_F('CrSettingsSecureDnsTest', 'All', function() {
mocha.run();
});
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