Commit e802888d authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS SplitSettings] F-Z tests that can be moved directly to chromeos

Change-Id: Ida5a4a12042d2b8845294f8630d951b99b45c6bc
Bug: 968182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695692
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarMay Lippert <maybelle@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678555}
parent c8c253e0
...@@ -31,7 +31,6 @@ class TestGoogleAssistantBrowserProxy extends TestBrowserProxy { ...@@ -31,7 +31,6 @@ class TestGoogleAssistantBrowserProxy extends TestBrowserProxy {
} }
suite('GoogleAssistantHandler', function() { suite('GoogleAssistantHandler', function() {
/** @type {SettingsGoogleAssistantPageElement} */ /** @type {SettingsGoogleAssistantPageElement} */
let page = null; let page = null;
......
...@@ -168,11 +168,7 @@ suite('InternetDetailPage', function() { ...@@ -168,11 +168,7 @@ suite('InternetDetailPage', function() {
Type: 'WiFi', Type: 'WiFi',
Source: 'Device', Source: 'Device',
ProxySettings: { ProxySettings: {
Type: { Type: {Active: 'Manual', Effective: 'UserPolicy', UserEditable: false}
Active: 'Manual',
Effective: 'UserPolicy',
UserEditable: false
}
} }
}]); }]);
internetDetailPage.init('wifi_user_guid', 'WiFi', 'wifi_user'); internetDetailPage.init('wifi_user_guid', 'WiFi', 'wifi_user');
......
...@@ -124,11 +124,12 @@ suite('Multidevice', function() { ...@@ -124,11 +124,12 @@ suite('Multidevice', function() {
// This code simulates the authentication and toggling by directly toggling // This code simulates the authentication and toggling by directly toggling
// the feature to enabled when the feature toggle is clicked. // the feature to enabled when the feature toggle is clicked.
let featureToggle = getSmartLockFeatureToggle(); let featureToggle = getSmartLockFeatureToggle();
const whenFeatureClicked = test_util.eventToPromise( const whenFeatureClicked =
'feature-toggle-clicked', featureToggle).then(() => { test_util.eventToPromise('feature-toggle-clicked', featureToggle)
setSmartLockFeatureState( .then(() => {
settings.MultiDeviceFeatureState.ENABLED_BY_USER); setSmartLockFeatureState(
}); settings.MultiDeviceFeatureState.ENABLED_BY_USER);
});
// Toggle the feature to enabled. // Toggle the feature to enabled.
toggleControl.click(); toggleControl.click();
...@@ -156,10 +157,13 @@ suite('Multidevice', function() { ...@@ -156,10 +157,13 @@ suite('Multidevice', function() {
// This code simulates the user cancelling authentication by ignoring the // This code simulates the user cancelling authentication by ignoring the
// toggle being clicked. // toggle being clicked.
let featureToggle = getSmartLockFeatureToggle(); let featureToggle = getSmartLockFeatureToggle();
const whenFeatureClicked = test_util.eventToPromise( const whenFeatureClicked =
'feature-toggle-clicked', featureToggle).then(() => { test_util.eventToPromise('feature-toggle-clicked', featureToggle)
// Do not enable the feature (simulating the user cancelling auth). .then(
}); () => {
// Do not enable the feature (simulating the user cancelling
// auth).
});
// Toggle the feature to enabled. // Toggle the feature to enabled.
toggleControl.click(); toggleControl.click();
...@@ -175,8 +179,8 @@ suite('Multidevice', function() { ...@@ -175,8 +179,8 @@ suite('Multidevice', function() {
smartLockSubPage = createSmartLockSubPage(); smartLockSubPage = createSmartLockSubPage();
let smartLockSignInRadio = getSmartLockSignInRadio(); let smartLockSignInRadio = getSmartLockSignInRadio();
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
}); });
test('Smart Lock signin enabled', function() { test('Smart Lock signin enabled', function() {
...@@ -186,12 +190,12 @@ suite('Multidevice', function() { ...@@ -186,12 +190,12 @@ suite('Multidevice', function() {
smartLockSubPage = createSmartLockSubPage(); smartLockSubPage = createSmartLockSubPage();
let smartLockSignInRadio = getSmartLockSignInRadio(); let smartLockSignInRadio = getSmartLockSignInRadio();
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
return whenSignInEnabledSet.then(() => { return whenSignInEnabledSet.then(() => {
assertEquals(settings.SignInEnabledState.ENABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.ENABLED, smartLockSignInRadio.selected);
}); });
}); });
...@@ -199,26 +203,25 @@ suite('Multidevice', function() { ...@@ -199,26 +203,25 @@ suite('Multidevice', function() {
smartLockSubPage = createSmartLockSubPage(); smartLockSubPage = createSmartLockSubPage();
let smartLockSignInRadio = getSmartLockSignInRadio(); let smartLockSignInRadio = getSmartLockSignInRadio();
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
cr.webUIListenerCallback('smart-lock-signin-enabled-changed', true); cr.webUIListenerCallback('smart-lock-signin-enabled-changed', true);
Polymer.dom.flush(); Polymer.dom.flush();
assertEquals(settings.SignInEnabledState.ENABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.ENABLED, smartLockSignInRadio.selected);
}); });
test('Smart Lock sign in successful authentication', function() { test('Smart Lock sign in successful authentication', function() {
smartLockSubPage = createSmartLockSubPage(); smartLockSubPage = createSmartLockSubPage();
let smartLockSignInRadio = getSmartLockSignInRadio(); let smartLockSignInRadio = getSmartLockSignInRadio();
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
// The password dialog is not visible. // The password dialog is not visible.
let passwordDialog = let passwordDialog = smartLockSubPage.$$('settings-password-prompt-dialog');
smartLockSubPage.$$('settings-password-prompt-dialog');
assertTrue(!passwordDialog); assertTrue(!passwordDialog);
// Click the 'Enable sign in' radio. // Click the 'Enable sign in' radio.
...@@ -234,8 +237,8 @@ suite('Multidevice', function() { ...@@ -234,8 +237,8 @@ suite('Multidevice', function() {
// Sign in radio is still disabled because the user has not authenticated // Sign in radio is still disabled because the user has not authenticated
// using the password dialog. // using the password dialog.
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
// Simulate the user entering a valid password into the dialog. // Simulate the user entering a valid password into the dialog.
passwordDialog.authToken = 'validAuthToken'; passwordDialog.authToken = 'validAuthToken';
...@@ -252,8 +255,8 @@ suite('Multidevice', function() { ...@@ -252,8 +255,8 @@ suite('Multidevice', function() {
smartLockSubPage = createSmartLockSubPage(); smartLockSubPage = createSmartLockSubPage();
let smartLockSignInRadio = getSmartLockSignInRadio(); let smartLockSignInRadio = getSmartLockSignInRadio();
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
// The password dialog is not visible. // The password dialog is not visible.
let passwordDialog = smartLockSubPage.$$('settings-password-prompt-dialog'); let passwordDialog = smartLockSubPage.$$('settings-password-prompt-dialog');
...@@ -272,8 +275,8 @@ suite('Multidevice', function() { ...@@ -272,8 +275,8 @@ suite('Multidevice', function() {
// Sign in radio is still disabled because the user has not authenticated // Sign in radio is still disabled because the user has not authenticated
// using the password dialog. // using the password dialog.
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
// Simulate the user closing the password dialog. // Simulate the user closing the password dialog.
passwordDialog.dispatchEvent(new CustomEvent('close')); passwordDialog.dispatchEvent(new CustomEvent('close'));
...@@ -285,12 +288,11 @@ suite('Multidevice', function() { ...@@ -285,12 +288,11 @@ suite('Multidevice', function() {
// The password dialog is closed and unauthenticated, so sign in is still // The password dialog is closed and unauthenticated, so sign in is still
// disabled. // disabled.
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
}); });
test( test('Smart Lock disable sign in does not show password dialog', function() {
'Smart Lock disabling sign in does not show password dialog', function() {
smartLockSubPage = createSmartLockSubPage(); smartLockSubPage = createSmartLockSubPage();
// Set sign in as enabled. // Set sign in as enabled.
...@@ -298,8 +300,8 @@ suite('Multidevice', function() { ...@@ -298,8 +300,8 @@ suite('Multidevice', function() {
Polymer.dom.flush(); Polymer.dom.flush();
let smartLockSignInRadio = getSmartLockSignInRadio(); let smartLockSignInRadio = getSmartLockSignInRadio();
assertEquals(settings.SignInEnabledState.ENABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.ENABLED, smartLockSignInRadio.selected);
// The password dialog is not visible. // The password dialog is not visible.
let passwordDialog = smartLockSubPage.$$('settings-password-prompt-dialog'); let passwordDialog = smartLockSubPage.$$('settings-password-prompt-dialog');
...@@ -317,8 +319,8 @@ suite('Multidevice', function() { ...@@ -317,8 +319,8 @@ suite('Multidevice', function() {
assertTrue(!passwordDialog); assertTrue(!passwordDialog);
// Sign in radio is now disabled. // Sign in radio is now disabled.
assertEquals(settings.SignInEnabledState.DISABLED, assertEquals(
smartLockSignInRadio.selected); settings.SignInEnabledState.DISABLED, smartLockSignInRadio.selected);
}); });
test('Smart Lock sign in control enabled by default', function() { test('Smart Lock sign in control enabled by default', function() {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
cr.define('multidevice', function() { cr.define('multidevice', function() {
/** /**
* Default Host device for PageContentData. * Default Host device for PageContentData.
*/ */
......
...@@ -453,7 +453,7 @@ CrSettingsPeoplePageQuickUnlockAuthenticateTest.prototype = { ...@@ -453,7 +453,7 @@ CrSettingsPeoplePageQuickUnlockAuthenticateTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../fake_chrome_event.js', 'chromeos/fake_quick_unlock_private.js', '../fake_chrome_event.js', 'chromeos/fake_quick_unlock_private.js',
'chromeos/fake_quick_unlock_uma.js', 'chromeos/fake_quick_unlock_uma.js',
'quick_unlock_authenticate_browsertest_chromeos.js' 'chromeos/quick_unlock_authenticate_browsertest_chromeos.js'
]), ]),
}; };
...@@ -481,7 +481,7 @@ CrSettingsPeoplePageLockScreenTest.prototype = { ...@@ -481,7 +481,7 @@ CrSettingsPeoplePageLockScreenTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../fake_chrome_event.js', 'chromeos/fake_quick_unlock_private.js', '../fake_chrome_event.js', 'chromeos/fake_quick_unlock_private.js',
'fake_settings_private.js', 'chromeos/fake_quick_unlock_uma.js', 'fake_settings_private.js', 'chromeos/fake_quick_unlock_uma.js',
'quick_unlock_authenticate_browsertest_chromeos.js', 'test_util.js' 'chromeos/quick_unlock_authenticate_browsertest_chromeos.js', 'test_util.js'
]), ]),
}; };
...@@ -510,7 +510,7 @@ CrSettingsPeoplePageSetupPinDialogTest.prototype = { ...@@ -510,7 +510,7 @@ CrSettingsPeoplePageSetupPinDialogTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../fake_chrome_event.js', 'chromeos/fake_quick_unlock_private.js', '../fake_chrome_event.js', 'chromeos/fake_quick_unlock_private.js',
'fake_settings_private.js', 'chromeos/fake_quick_unlock_uma.js', 'fake_settings_private.js', 'chromeos/fake_quick_unlock_uma.js',
'quick_unlock_authenticate_browsertest_chromeos.js' 'chromeos/quick_unlock_authenticate_browsertest_chromeos.js'
]), ]),
}; };
...@@ -564,7 +564,7 @@ CrSettingsPeoplePageChangePictureTest.prototype = { ...@@ -564,7 +564,7 @@ CrSettingsPeoplePageChangePictureTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js', '../test_browser_proxy.js',
'people_page_change_picture_test.js', 'chromeos/people_page_change_picture_test.js',
]), ]),
}; };
...@@ -594,7 +594,7 @@ CrSettingsPeoplePageAccountManagerTest.prototype = { ...@@ -594,7 +594,7 @@ CrSettingsPeoplePageAccountManagerTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js', '../test_browser_proxy.js',
'people_page_account_manager_test.js', 'chromeos/people_page_account_manager_test.js',
]), ]),
}; };
...@@ -621,7 +621,7 @@ CrSettingsPeoplePageKerberosAccountsTest.prototype = { ...@@ -621,7 +621,7 @@ CrSettingsPeoplePageKerberosAccountsTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js', '../test_browser_proxy.js',
'people_page_kerberos_accounts_test.js', 'chromeos/people_page_kerberos_accounts_test.js',
]), ]),
}; };
...@@ -1423,7 +1423,7 @@ CrSettingsSiteListTest.prototype = { ...@@ -1423,7 +1423,7 @@ CrSettingsSiteListTest.prototype = {
'../test_browser_proxy.js', '../test_browser_proxy.js',
'test_util.js', 'test_util.js',
'test_site_settings_prefs_browser_proxy.js', 'test_site_settings_prefs_browser_proxy.js',
'test_multidevice_browser_proxy.js', 'chromeos/test_multidevice_browser_proxy.js',
'site_list_tests.js', 'site_list_tests.js',
]), ]),
}; };
...@@ -1663,7 +1663,7 @@ CrSettingsInternetPageTest.prototype = { ...@@ -1663,7 +1663,7 @@ CrSettingsInternetPageTest.prototype = {
'../chromeos/fake_network_config_mojom.js', '../chromeos/fake_network_config_mojom.js',
'../chromeos/fake_networking_private.js', '../chromeos/fake_networking_private.js',
'../chromeos/cr_onc_strings.js', '../chromeos/cr_onc_strings.js',
'internet_page_tests.js', 'chromeos/internet_page_tests.js',
]), ]),
}; };
...@@ -1692,7 +1692,7 @@ CrSettingsInternetDetailPageTest.prototype = { ...@@ -1692,7 +1692,7 @@ CrSettingsInternetDetailPageTest.prototype = {
'../fake_chrome_event.js', '../fake_chrome_event.js',
'../chromeos/fake_networking_private.js', '../chromeos/fake_networking_private.js',
'../chromeos/cr_onc_strings.js', '../chromeos/cr_onc_strings.js',
'internet_detail_page_tests.js', 'chromeos/internet_detail_page_tests.js',
]), ]),
}; };
...@@ -2160,7 +2160,7 @@ CrSettingsMultideviceFeatureItemTest.prototype = { ...@@ -2160,7 +2160,7 @@ CrSettingsMultideviceFeatureItemTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'multidevice_feature_item_tests.js', 'chromeos/multidevice_feature_item_tests.js',
]), ]),
}; };
...@@ -2184,7 +2184,7 @@ CrSettingsMultideviceFeatureToggleTest.prototype = { ...@@ -2184,7 +2184,7 @@ CrSettingsMultideviceFeatureToggleTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'multidevice_feature_toggle_tests.js', 'chromeos/multidevice_feature_toggle_tests.js',
]), ]),
}; };
...@@ -2208,8 +2208,8 @@ CrSettingsMultidevicePageTest.prototype = { ...@@ -2208,8 +2208,8 @@ CrSettingsMultidevicePageTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js', '../test_browser_proxy.js',
'test_multidevice_browser_proxy.js', 'chromeos/test_multidevice_browser_proxy.js',
'multidevice_page_tests.js', 'chromeos/multidevice_page_tests.js',
]), ]),
}; };
...@@ -2234,9 +2234,9 @@ CrSettingsMultideviceSmartLockSubpageTest.prototype = { ...@@ -2234,9 +2234,9 @@ CrSettingsMultideviceSmartLockSubpageTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js', '../test_browser_proxy.js',
'test_multidevice_browser_proxy.js', 'chromeos/test_multidevice_browser_proxy.js',
'test_util.js', 'test_util.js',
'multidevice_smartlock_subpage_test.js', 'chromeos/multidevice_smartlock_subpage_test.js',
]), ]),
}; };
...@@ -2260,8 +2260,8 @@ CrSettingsMultideviceSubpageTest.prototype = { ...@@ -2260,8 +2260,8 @@ CrSettingsMultideviceSubpageTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js', '../test_browser_proxy.js',
'test_multidevice_browser_proxy.js', 'chromeos/test_multidevice_browser_proxy.js',
'multidevice_subpage_tests.js', 'chromeos/multidevice_subpage_tests.js',
]), ]),
}; };
...@@ -2288,7 +2288,7 @@ CrSettingsCrostiniPageTest.prototype = { ...@@ -2288,7 +2288,7 @@ CrSettingsCrostiniPageTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'//ui/webui/resources/js/promise_resolver.js', '//ui/webui/resources/js/promise_resolver.js',
'../test_browser_proxy.js', '../test_browser_proxy.js',
'test_crostini_browser_proxy.js', 'chromeos/test_crostini_browser_proxy.js',
'chromeos/crostini_page_test.js', 'chromeos/crostini_page_test.js',
]), ]),
}; };
...@@ -2314,7 +2314,7 @@ CrSettingsPluginVmPageTest.prototype = { ...@@ -2314,7 +2314,7 @@ CrSettingsPluginVmPageTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'//ui/webui/resources/js/promise_resolver.js', '//ui/webui/resources/js/promise_resolver.js',
'../test_browser_proxy.js', '../test_browser_proxy.js',
'plugin_vm_page_test.js', 'chromeos/plugin_vm_page_test.js',
]), ]),
}; };
...@@ -2338,11 +2338,12 @@ CrSettingsAndroidAppsPageTest.prototype = { ...@@ -2338,11 +2338,12 @@ CrSettingsAndroidAppsPageTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'//ui/webui/resources/js/promise_resolver.js', '//ui/webui/resources/js/promise_resolver.js',
'../test_browser_proxy.js', '../test_browser_proxy.js',
'test_android_apps_browser_proxy.js', 'chromeos/test_android_apps_browser_proxy.js',
'chromeos/android_apps_page_test.js', 'chromeos/android_apps_page_test.js',
]), ]),
}; };
// Disabled due to flakiness on linux-chromeos-rel
TEST_F('CrSettingsAndroidAppsPageTest', 'DISABLED_All', function() { TEST_F('CrSettingsAndroidAppsPageTest', 'DISABLED_All', function() {
mocha.run(); mocha.run();
}); });
...@@ -2362,7 +2363,7 @@ CrSettingsDateTimePageTest.prototype = { ...@@ -2362,7 +2363,7 @@ CrSettingsDateTimePageTest.prototype = {
/** @override */ /** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'date_time_page_tests.js', 'chromeos/date_time_page_tests.js',
]), ]),
}; };
...@@ -2392,7 +2393,7 @@ CrSettingsGoogleAssistantPageTest.prototype = { ...@@ -2392,7 +2393,7 @@ CrSettingsGoogleAssistantPageTest.prototype = {
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'//ui/webui/resources/js/promise_resolver.js', '//ui/webui/resources/js/promise_resolver.js',
'../test_browser_proxy.js', '../test_browser_proxy.js',
'google_assistant_page_test.js', 'chromeos/google_assistant_page_test.js',
]), ]),
}; };
......
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