| 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 PolymerTest.clearBody(); | 8 PolymerTest.clearBody(); |
| 9 var controlBarElement = document.createElement('control-bar'); | 9 var controlBarElement = document.createElement('control-bar'); |
| 10 document.body.appendChild(controlBarElement); | 10 document.body.appendChild(controlBarElement); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 test('Cannot create profile', function() { | 86 test('Cannot create profile', function() { |
| 87 // Simulate clicking 'Create Profile'. | 87 // Simulate clicking 'Create Profile'. |
| 88 MockInteractions.tap(controlBarElement.$.addUser); | 88 MockInteractions.tap(controlBarElement.$.addUser); |
| 89 | 89 |
| 90 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { | 90 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { |
| 91 // Make sure DOM is up to date. | 91 // Make sure DOM is up to date. |
| 92 Polymer.dom.flush(); | 92 Polymer.dom.flush(); |
| 93 | 93 |
| 94 // The dialog is visible. | 94 // The dialog is visible. |
| 95 assertLT(0, errorDialogElement.$$('#backdrop').offsetHeight); | 95 assertLT(0, errorDialogElement.$.dialog.$$('#backdrop').offsetHeight); |
| 96 }); | 96 }); |
| 97 }); | 97 }); |
| 98 | 98 |
| 99 test('Cannot launch guest profile', function() { | 99 test('Cannot launch guest profile', function() { |
| 100 // Simulate clicking 'Browse as guest'. | 100 // Simulate clicking 'Browse as guest'. |
| 101 MockInteractions.tap(controlBarElement.$.launchGuest); | 101 MockInteractions.tap(controlBarElement.$.launchGuest); |
| 102 | 102 |
| 103 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { | 103 return browserProxy.whenCalled('areAllProfilesLocked').then(function() { |
| 104 // Make sure DOM is up to date. | 104 // Make sure DOM is up to date. |
| 105 Polymer.dom.flush(); | 105 Polymer.dom.flush(); |
| 106 | 106 |
| 107 // The error dialog is visible. | 107 // The error dialog is visible. |
| 108 assertLT(0, errorDialogElement.$$('#backdrop').offsetHeight); | 108 assertLT(0, errorDialogElement.$.dialog.$$('#backdrop').offsetHeight); |
| 109 }); | 109 }); |
| 110 }); | 110 }); |
| 111 }); | 111 }); |
| 112 } | 112 } |
| 113 | 113 |
| 114 return { | 114 return { |
| 115 registerTests: registerTests, | 115 registerTests: registerTests, |
| 116 }; | 116 }; |
| 117 }); | 117 }); |
| OLD | NEW |