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

Unified Diff: chrome/test/data/webui/md_user_manager/control_bar_tests.js

Issue 2020093002: MD User Manager: Browser Tests for when all profiles are locked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md-user-manager-locked
Patch Set: Addressed comments Created 4 years, 7 months 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 | « no previous file | chrome/test/data/webui/md_user_manager/test_profile_browser_proxy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_user_manager/control_bar_tests.js
diff --git a/chrome/test/data/webui/md_user_manager/control_bar_tests.js b/chrome/test/data/webui/md_user_manager/control_bar_tests.js
index 5adfbd97108aa70ca0fb103e1683069355e8196a..f6901059557fb13a613864c03735b94ef1d27061 100644
--- a/chrome/test/data/webui/md_user_manager/control_bar_tests.js
+++ b/chrome/test/data/webui/md_user_manager/control_bar_tests.js
@@ -3,22 +3,28 @@
// found in the LICENSE file.
cr.define('user_manager.control_bar_tests', function() {
+ /** @return {!ControlBarElement} */
+ function createElement() {
+ PolymerTest.clearBody();
+ var controlBarElement = document.createElement('control-bar');
+ document.body.appendChild(controlBarElement);
+ return controlBarElement;
+ }
+
function registerTests() {
- suite('ControlBarTests', function() {
- /** @type {?TestProfileBrowserProxy} */
- var browserProxy = null;
+ /** @type {?TestProfileBrowserProxy} */
+ var browserProxy = null;
- /** @type {?ControlBarElement} */
- var controlBarElement = null;
+ /** @type {?ControlBarElement} */
+ var controlBarElement = null;
+ suite('ControlBarTests', function() {
setup(function() {
browserProxy = new TestProfileBrowserProxy();
// Replace real proxy with mock proxy.
signin.ProfileBrowserProxyImpl.instance_ = browserProxy;
- PolymerTest.clearBody();
- controlBarElement = document.createElement('control-bar');
- document.body.appendChild(controlBarElement);
+ controlBarElement = createElement();
});
teardown(function() { controlBarElement.remove(); });
@@ -54,6 +60,55 @@ cr.define('user_manager.control_bar_tests', function() {
return browserProxy.whenCalled('launchGuestUser');
});
});
+
+ suite('ControlBarTestsAllProfilesAreLocked', function() {
+ /** @type {?ErrorDialogElement} */
+ var errorDialogElement = null;
+
+ setup(function() {
+ browserProxy = new TestProfileBrowserProxy();
+ // Replace real proxy with mock proxy.
+ signin.ProfileBrowserProxyImpl.instance_ = browserProxy;
+
+ browserProxy.setAllProfilesLocked(true);
+
+ controlBarElement = createElement();
+
+ errorDialogElement = document.createElement('error-dialog');
+ document.body.appendChild(errorDialogElement);
+ });
+
+ teardown(function() {
+ controlBarElement.remove();
+ errorDialogElement.remove();
+ });
+
+ test('Cannot create profile', function() {
+ // Simulate clicking 'Create Profile'.
+ MockInteractions.tap(controlBarElement.$.addUser);
+
+ return browserProxy.whenCalled('areAllProfilesLocked').then(function() {
+ // Make sure DOM is up to date.
+ Polymer.dom.flush();
+
+ // The dialog is visible.
+ assertLT(0, errorDialogElement.$$('#backdrop').offsetHeight);
+ });
+ });
+
+ test('Cannot launch guest profile', function() {
+ // Simulate clicking 'Browse as guest'.
+ MockInteractions.tap(controlBarElement.$.launchGuest);
+
+ return browserProxy.whenCalled('areAllProfilesLocked').then(function() {
+ // Make sure DOM is up to date.
+ Polymer.dom.flush();
+
+ // The error dialog is visible.
+ assertLT(0, errorDialogElement.$$('#backdrop').offsetHeight);
+ });
+ });
+ });
}
return {
« no previous file with comments | « no previous file | chrome/test/data/webui/md_user_manager/test_profile_browser_proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698