Commit d3c7acf8 authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Commit Bot

[WebUI] Reformat Settings Tests

The current migration to Polymer 3 mistakenly used `clang-format-on`
instead of `clang-format on` after turning `clang-format` off via
`clang-format off`. This resulted in clang-format effectively being
disabled for affected files, this change fixes it. Steps:

- sed 's/clang-format-on/clang-format on/g'
- git cl format --js --full

TBR=dpapad

Bug: 1026426
Change-Id: I4364d325e3e7df1add0f83d93e8b18453f6014e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107591Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751331}
parent 029ff8f9
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; // #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js'; // #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js';
// #import {TestOpenWindowProxy} from 'chrome://test/settings/test_open_window_proxy.m.js'; // #import {TestOpenWindowProxy} from 'chrome://test/settings/test_open_window_proxy.m.js';
// clang-format-on // clang-format on
suite('PasswordsAndForms', function() { suite('PasswordsAndForms', function() {
/** /**
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// #import {eventToPromise} from 'chrome://test/test_util.m.js'; // #import {eventToPromise} from 'chrome://test/test_util.m.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; // #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; // #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// clang-format-on // clang-format on
cr.define('settings_autofill_section', function() { cr.define('settings_autofill_section', function() {
/** /**
......
...@@ -12,15 +12,14 @@ ...@@ -12,15 +12,14 @@
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; // #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; // #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js'; // #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js';
// clang-format-on // clang-format on
cr.define('settings_passwords_check', function() { cr.define('settings_passwords_check', function() {
const PasswordCheckState = chrome.passwordsPrivate.PasswordCheckState; const PasswordCheckState = chrome.passwordsPrivate.PasswordCheckState;
function createCheckPasswordSection() { function createCheckPasswordSection() {
// Create a passwords-section to use for testing. // Create a passwords-section to use for testing.
const passwordsSection = const passwordsSection = document.createElement('settings-password-check');
document.createElement('settings-password-check');
document.body.appendChild(passwordsSection); document.body.appendChild(passwordsSection);
Polymer.dom.flush(); Polymer.dom.flush();
return passwordsSection; return passwordsSection;
...@@ -93,8 +92,8 @@ cr.define('settings_passwords_check', function() { ...@@ -93,8 +92,8 @@ cr.define('settings_passwords_check', function() {
* passwordList The expected data. * passwordList The expected data.
* @private * @private
*/ */
function validateLeakedPasswordsList(checkPasswordSection, function validateLeakedPasswordsList(
compromisedCredentials) { checkPasswordSection, compromisedCredentials) {
const listElements = checkPasswordSection.$.leakedPasswordList; const listElements = checkPasswordSection.$.leakedPasswordList;
assertEquals(listElements.items.length, compromisedCredentials.length); assertEquals(listElements.items.length, compromisedCredentials.length);
const nodes = checkPasswordSection.shadowRoot.querySelectorAll( const nodes = checkPasswordSection.shadowRoot.querySelectorAll(
...@@ -287,8 +286,7 @@ cr.define('settings_passwords_check', function() { ...@@ -287,8 +286,7 @@ cr.define('settings_passwords_check', function() {
autofill_test_util.makePasswordCheckStatus( autofill_test_util.makePasswordCheckStatus(
/*state=*/ PasswordCheckState.NO_PASSWORDS); /*state=*/ PasswordCheckState.NO_PASSWORDS);
const section = createCheckPasswordSection(); const section = createCheckPasswordSection();
return passwordManager.whenCalled('getPasswordCheckStatus') return passwordManager.whenCalled('getPasswordCheckStatus').then(() => {
.then(() => {
expectFalse(isElementVisible(section.$.controlPasswordCheckButton)); expectFalse(isElementVisible(section.$.controlPasswordCheckButton));
}); });
}); });
...@@ -383,7 +381,7 @@ cr.define('settings_passwords_check', function() { ...@@ -383,7 +381,7 @@ cr.define('settings_passwords_check', function() {
removeDialog.$.remove.click(); removeDialog.$.remove.click();
return passwordManager.whenCalled('removeCompromisedCredential') return passwordManager.whenCalled('removeCompromisedCredential')
.then(({id, username, formattedOrigin}) => { .then(({id, username, formattedOrigin}) => {
assertEquals(0 , id); assertEquals(0, id);
assertEquals('test4', username); assertEquals('test4', username);
assertEquals('one.com', formattedOrigin); assertEquals('one.com', formattedOrigin);
}); });
...@@ -610,8 +608,8 @@ cr.define('settings_passwords_check', function() { ...@@ -610,8 +608,8 @@ cr.define('settings_passwords_check', function() {
const subtitle = section.$.subtitle; const subtitle = section.$.subtitle;
assertTrue(isElementVisible(title)); assertTrue(isElementVisible(title));
assertFalse(isElementVisible(subtitle)); assertFalse(isElementVisible(subtitle));
expectEquals(section.i18n('checkPasswordsDescription'), expectEquals(
title.innerText); section.i18n('checkPasswordsDescription'), title.innerText);
}); });
}); });
...@@ -984,8 +982,8 @@ cr.define('settings_passwords_check', function() { ...@@ -984,8 +982,8 @@ cr.define('settings_passwords_check', function() {
editDialog.$.passwordInput.value = 'yadhtribym'; editDialog.$.passwordInput.value = 'yadhtribym';
editDialog.$.cancel.click(); editDialog.$.cancel.click();
assertEquals(0, assertEquals(
passwordManager.getCallCount('changeCompromisedCredential')); 0, passwordManager.getCallCount('changeCompromisedCredential'));
}); });
}); });
// #cr_define_end // #cr_define_end
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js'; // #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js';
// #import {getSyncAllPrefs, simulateSyncStatus} from 'chrome://test/settings/sync_test_util.m.js'; // #import {getSyncAllPrefs, simulateSyncStatus} from 'chrome://test/settings/sync_test_util.m.js';
// #import {isChromeOS} from 'chrome://resources/js/cr.m.js'; // #import {isChromeOS} from 'chrome://resources/js/cr.m.js';
// clang-format-on // clang-format on
cr.define('settings_passwords_section', function() { cr.define('settings_passwords_section', function() {
const PasswordCheckState = chrome.passwordsPrivate.PasswordCheckState; const PasswordCheckState = chrome.passwordsPrivate.PasswordCheckState;
...@@ -33,8 +33,8 @@ cr.define('settings_passwords_section', function() { ...@@ -33,8 +33,8 @@ cr.define('settings_passwords_section', function() {
const listElement = passwordsSection.$.passwordList; const listElement = passwordsSection.$.passwordList;
assertEquals(passwordList.length, listElement.items.length); assertEquals(passwordList.length, listElement.items.length);
for (let index = 0; index < passwordList.length; ++index) { for (let index = 0; index < passwordList.length; ++index) {
const listItems = passwordsSection.shadowRoot.querySelectorAll( const listItems =
'password-list-item'); passwordsSection.shadowRoot.querySelectorAll('password-list-item');
const node = listItems[index]; const node = listItems[index];
assertTrue(!!node); assertTrue(!!node);
const passwordInfo = passwordList[index]; const passwordInfo = passwordList[index];
...@@ -925,10 +925,8 @@ cr.define('settings_passwords_section', function() { ...@@ -925,10 +925,8 @@ cr.define('settings_passwords_section', function() {
passwordsSection.$$('#checkPasswordsBannerContainer').hidden); passwordsSection.$$('#checkPasswordsBannerContainer').hidden);
assertTrue(passwordsSection.$$('#checkPasswordsButton').hidden); assertTrue(passwordsSection.$$('#checkPasswordsButton').hidden);
assertFalse(passwordsSection.$$('#checkPasswordsLinkRow').hidden); assertFalse(passwordsSection.$$('#checkPasswordsLinkRow').hidden);
assertTrue( assertTrue(passwordsSection.$$('#checkPasswordLeakDescription').hidden);
passwordsSection.$$('#checkPasswordLeakDescription').hidden); assertFalse(passwordsSection.$$('#checkPasswordWarningIcon').hidden);
assertFalse(
passwordsSection.$$('#checkPasswordWarningIcon').hidden);
assertFalse(passwordsSection.$$('#checkPasswordLeakCount').hidden); assertFalse(passwordsSection.$$('#checkPasswordLeakCount').hidden);
}); });
}); });
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; // #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// #import {MockTimer} from 'chrome://test/mock_timer.m.js'; // #import {MockTimer} from 'chrome://test/mock_timer.m.js';
// #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js'; // #import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.m.js';
// clang-format-on // clang-format on
cr.define('settings_passwords_section_cros', function() { cr.define('settings_passwords_section_cros', function() {
suite('PasswordsSection_Cros', function() { suite('PasswordsSection_Cros', function() {
...@@ -78,8 +78,8 @@ cr.define('settings_passwords_section_cros', function() { ...@@ -78,8 +78,8 @@ cr.define('settings_passwords_section_cros', function() {
const dialog = super.createExportPasswordsDialog(passwordManager); const dialog = super.createExportPasswordsDialog(passwordManager);
dialog.tokenRequestManager = new settings.BlockingRequestManager(); dialog.tokenRequestManager = new settings.BlockingRequestManager();
return overrideRequestManager ? return overrideRequestManager ?
Object.assign(dialog, Object.assign(
{tokenRequestManager: this.tokenRequestManager}) : dialog, {tokenRequestManager: this.tokenRequestManager}) :
dialog; dialog;
} }
...@@ -208,8 +208,8 @@ cr.define('settings_passwords_section_cros', function() { ...@@ -208,8 +208,8 @@ cr.define('settings_passwords_section_cros', function() {
// Note (rbpotter): this passes locally, but may still be flaky (see // Note (rbpotter): this passes locally, but may still be flaky (see
// https://www.crbug.com/1021474) // https://www.crbug.com/1021474)
test.skip('password-prompt-dialog appears on auth token request', test.skip(
function() { 'password-prompt-dialog appears on auth token request', function() {
const passwordsSection = const passwordsSection =
elementFactory.createPasswordsSection(passwordManager); elementFactory.createPasswordsSection(passwordManager);
assertTrue(!passwordsSection.$$('settings-password-prompt-dialog')); assertTrue(!passwordsSection.$$('settings-password-prompt-dialog'));
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; // #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {eventToPromise, isVisible, whenAttributeIs} from 'chrome://test/test_util.m.js'; // #import {eventToPromise, isVisible, whenAttributeIs} from 'chrome://test/test_util.m.js';
// #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; // #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// clang-format-on // clang-format on
cr.define('settings_payments_section', function() { cr.define('settings_payments_section', function() {
suite('PaymentSectionUiTest', function() { suite('PaymentSectionUiTest', function() {
...@@ -627,8 +627,7 @@ cr.define('settings_payments_section', function() { ...@@ -627,8 +627,7 @@ cr.define('settings_payments_section', function() {
const result = await testMetricsBrowserProxy.whenCalled( const result = await testMetricsBrowserProxy.whenCalled(
'recordSettingsPageHistogram'); 'recordSettingsPageHistogram');
assertEquals( assertEquals(settings.PrivacyElementInteractions.PAYMENT_METHOD, result);
settings.PrivacyElementInteractions.PAYMENT_METHOD, result);
}); });
}); });
// #cr_define_end // #cr_define_end
......
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