Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6608)

Unified Diff: chrome/test/data/webui/settings/people_page_manage_profile_test.js

Issue 2498153002: [MD Settings][MD User Manager] create/manage profile desktop shortcut (Windows only) (Closed)
Patch Set: Addressed comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/md_user_manager/test_profile_browser_proxy.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/people_page_manage_profile_test.js
diff --git a/chrome/test/data/webui/settings/people_page_manage_profile_test.js b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
index 0c63889f5d0ab7660b8547018971f2916d97ee2f..c4247a61f042b4c5c33e8ed7ddd1fff2a28505a4 100644
--- a/chrome/test/data/webui/settings/people_page_manage_profile_test.js
+++ b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
@@ -12,6 +12,9 @@ cr.define('settings_people_page_manage_profile', function() {
settings.TestBrowserProxy.call(this, [
'getAvailableIcons',
'setProfileIconAndName',
+ 'getHasProfileShortcut',
+ 'addProfileShortcut',
+ 'removeProfileShortcut',
]);
};
@@ -29,6 +32,21 @@ cr.define('settings_people_page_manage_profile', function() {
setProfileIconAndName: function(iconUrl, name) {
this.methodCalled('setProfileIconAndName', [iconUrl, name]);
},
+
+ getHasProfileShortcut: function() {
+ this.methodCalled('getHasProfileShortcut');
+ return Promise.resolve(true);
+ },
+
+ /** @override */
+ addProfileShortcut: function() {
+ this.methodCalled('addProfileShortcut');
+ },
+
+ /** @override */
+ removeProfileShortcut: function() {
+ this.methodCalled('removeProfileShortcut');
+ },
};
function registerManageProfileTests() {
@@ -45,6 +63,7 @@ cr.define('settings_people_page_manage_profile', function() {
manageProfile.profileName = 'Initial Fake Name';
manageProfile.syncStatus = {supervisedUser: false, childUser: false};
document.body.appendChild(manageProfile);
+ settings.navigateTo(settings.Route.MANAGE_PROFILE);
});
teardown(function() { manageProfile.remove(); });
@@ -131,6 +150,66 @@ cr.define('settings_people_page_manage_profile', function() {
assertEquals('New Name From Browser', nameField.value);
});
});
+
+ // Tests profile shortcut toggle is hidden if profile shortcuts feature is
+ // disabled.
+ test('ManageProfileShortcutToggleHidden', function() {
+ var hasShortcutToggle = manageProfile.$$('#hasShortcutToggle');
+ assertFalse(!!hasShortcutToggle);
+ });
+ });
+
+ suite('ManageProfileTestsProfileShortcutsEnabled', function() {
+ var manageProfile = null;
+ var browserProxy = null;
+
+ setup(function() {
+ loadTimeData.overrideValues({
+ profileShortcutsEnabled: true,
+ });
+
+ browserProxy = new TestManageProfileBrowserProxy();
+ settings.ManageProfileBrowserProxyImpl.instance_ = browserProxy;
+ PolymerTest.clearBody();
+ manageProfile = document.createElement('settings-manage-profile');
+ manageProfile.profileIconUrl = 'fake-icon-1.png';
+ manageProfile.profileName = 'Initial Fake Name';
+ manageProfile.syncStatus = {supervisedUser: false, childUser: false};
+ document.body.appendChild(manageProfile);
+ settings.navigateTo(settings.Route.MANAGE_PROFILE);
+ Polymer.dom.flush();
+ });
+
+ teardown(function() { manageProfile.remove(); });
+
+ // Tests profile shortcut toggle is visible and toggling it removes and
+ // creates the profile shortcut respectively.
+ test('ManageProfileShortcutToggle', function() {
+ var hasShortcutToggle = manageProfile.$$('#hasShortcutToggle');
+ assertTrue(!!hasShortcutToggle);
+
+ return browserProxy.whenCalled('getHasProfileShortcut')
+ .then(function() {
+ Polymer.dom.flush();
+
+ // The profile shortcut toggle is checked.
+ assertTrue(hasShortcutToggle.active);
+
+ // Simulate tapping the profile shortcut toggle.
+ MockInteractions.tap(hasShortcutToggle);
+ return browserProxy.whenCalled('removeProfileShortcut')
+ .then(function() {
+ Polymer.dom.flush();
+
+ // The profile shortcut toggle is checked.
+ assertFalse(hasShortcutToggle.active);
+
+ // Simulate tapping the profile shortcut toggle.
+ MockInteractions.tap(hasShortcutToggle);
+ return browserProxy.whenCalled('addProfileShortcut');
+ });
+ });
+ });
});
}
« no previous file with comments | « chrome/test/data/webui/md_user_manager/test_profile_browser_proxy.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698