| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('user_manager.control_bar_tests', function() { | 5 cr.define('user_manager.control_bar_tests', function() { |
| 6 /** @return {!ControlBarElement} */ | 6 /** @return {!ControlBarElement} */ |
| 7 function createElement() { | 7 function createElement() { |
| 8 var controlBarElement = document.createElement('control-bar'); | 8 var controlBarElement = document.createElement('control-bar'); |
| 9 document.body.appendChild(controlBarElement); | 9 document.body.appendChild(controlBarElement); |
| 10 return controlBarElement; | 10 return controlBarElement; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 test('Cannot create profile', function() { | 89 test('Cannot create profile', function() { |
| 90 // Simulate clicking 'Create Profile'. | 90 // Simulate clicking 'Create Profile'. |
| 91 MockInteractions.tap(controlBarElement.$.addUser); | 91 MockInteractions.tap(controlBarElement.$.addUser); |
| 92 | 92 |
| 93 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { | 93 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { |
| 94 // Make sure DOM is up to date. | 94 // Make sure DOM is up to date. |
| 95 Polymer.dom.flush(); | 95 Polymer.dom.flush(); |
| 96 | 96 |
| 97 // The dialog is visible. | 97 // The dialog is visible. |
| 98 assertLT(0, errorDialogElement.$$('#backdrop').offsetHeight); | 98 assertTrue(errorDialogElement.$.dialog.opened); |
| 99 }); | 99 }); |
| 100 }); | 100 }); |
| 101 | 101 |
| 102 test('Cannot launch guest profile', function() { | 102 test('Cannot launch guest profile', function() { |
| 103 // Simulate clicking 'Browse as guest'. | 103 // Simulate clicking 'Browse as guest'. |
| 104 MockInteractions.tap(controlBarElement.$.launchGuest); | 104 MockInteractions.tap(controlBarElement.$.launchGuest); |
| 105 | 105 |
| 106 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { | 106 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { |
| 107 // Make sure DOM is up to date. | 107 // Make sure DOM is up to date. |
| 108 Polymer.dom.flush(); | 108 Polymer.dom.flush(); |
| 109 | 109 |
| 110 // The error dialog is visible. | 110 // The error dialog is visible. |
| 111 assertLT(0, errorDialogElement.$$('#backdrop').offsetHeight); | 111 assertTrue(errorDialogElement.$.dialog.opened); |
| 112 }); | 112 }); |
| 113 }); | 113 }); |
| 114 }); | 114 }); |
| 115 } | 115 } |
| 116 | 116 |
| 117 return { | 117 return { |
| 118 registerTests: registerTests, | 118 registerTests: registerTests, |
| 119 }; | 119 }; |
| 120 }); | 120 }); |
| OLD | NEW |