| 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('settings_people_page', function() { | 5 cr.define('settings_people_page', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {settings.ProfileInfoBrowserProxy} | 8 * @implements {settings.ProfileInfoBrowserProxy} |
| 9 * @extends {settings.TestBrowserProxy} | 9 * @extends {settings.TestBrowserProxy} |
| 10 */ | 10 */ |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 document.body.appendChild(peoplePage); | 86 document.body.appendChild(peoplePage); |
| 87 }); | 87 }); |
| 88 | 88 |
| 89 teardown(function() { peoplePage.remove(); }); | 89 teardown(function() { peoplePage.remove(); }); |
| 90 | 90 |
| 91 test('GetProfileInfo', function() { | 91 test('GetProfileInfo', function() { |
| 92 return browserProxy.whenCalled('getProfileInfo').then(function() { | 92 return browserProxy.whenCalled('getProfileInfo').then(function() { |
| 93 Polymer.dom.flush(); | 93 Polymer.dom.flush(); |
| 94 assertEquals(browserProxy.fakeProfileInfo.name, | 94 assertEquals(browserProxy.fakeProfileInfo.name, |
| 95 peoplePage.$$('#profile-name').textContent.trim()); | 95 peoplePage.$$('#profile-name').textContent.trim()); |
| 96 assertEquals(browserProxy.fakeProfileInfo.iconUrl, | 96 var bg = peoplePage.$$('#profile-icon').style.backgroundImage; |
| 97 peoplePage.$$('#profile-icon').src); | 97 assertTrue(bg.includes(browserProxy.fakeProfileInfo.iconUrl)); |
| 98 | 98 |
| 99 cr.webUIListenerCallback( | 99 cr.webUIListenerCallback( |
| 100 'profile-info-changed', | 100 'profile-info-changed', |
| 101 {name: 'pushedName', iconUrl: 'http://pushed-url/'}); | 101 {name: 'pushedName', iconUrl: 'http://pushed-url/'}); |
| 102 | 102 |
| 103 Polymer.dom.flush(); | 103 Polymer.dom.flush(); |
| 104 assertEquals('pushedName', | 104 assertEquals('pushedName', |
| 105 peoplePage.$$('#profile-name').textContent.trim()); | 105 peoplePage.$$('#profile-name').textContent.trim()); |
| 106 assertEquals('http://pushed-url/', | 106 var newBg = peoplePage.$$('#profile-icon').style.backgroundImage; |
| 107 peoplePage.$$('#profile-icon').src); | 107 assertTrue(newBg.includes('http://pushed-url/')); |
| 108 }); | 108 }); |
| 109 }); | 109 }); |
| 110 | 110 |
| 111 test('GetProfileManagesSupervisedUsers', function() { | 111 test('GetProfileManagesSupervisedUsers', function() { |
| 112 return browserProxy.whenCalled('getProfileManagesSupervisedUsers').then( | 112 return browserProxy.whenCalled('getProfileManagesSupervisedUsers').then( |
| 113 function() { | 113 function() { |
| 114 Polymer.dom.flush(); | 114 Polymer.dom.flush(); |
| 115 assertFalse(!!peoplePage.$$('#manageSupervisedUsersContainer')); | 115 assertFalse(!!peoplePage.$$('#manageSupervisedUsersContainer')); |
| 116 | 116 |
| 117 cr.webUIListenerCallback( | 117 cr.webUIListenerCallback( |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 245 } |
| 246 | 246 |
| 247 return { | 247 return { |
| 248 registerTests: function() { | 248 registerTests: function() { |
| 249 registerProfileInfoTests(); | 249 registerProfileInfoTests(); |
| 250 if (!cr.isChromeOS) | 250 if (!cr.isChromeOS) |
| 251 registerSyncStatusTests(); | 251 registerSyncStatusTests(); |
| 252 }, | 252 }, |
| 253 }; | 253 }; |
| 254 }); | 254 }); |
| OLD | NEW |