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