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

Side by Side Diff: chrome/test/data/webui/settings/people_page_test.js

Issue 2451423002: [MD Settings][People] Fixes the 'arrow icon' appearing momentarily on page refresh. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/people_page/people_page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 /** @override */ 62 /** @override */
63 signOut: function(deleteProfile) { 63 signOut: function(deleteProfile) {
64 this.methodCalled('signOut', deleteProfile); 64 this.methodCalled('signOut', deleteProfile);
65 }, 65 },
66 }; 66 };
67 67
68 function registerProfileInfoTests() { 68 function registerProfileInfoTests() {
69 suite('ProfileInfoTests', function() { 69 suite('ProfileInfoTests', function() {
70 var peoplePage = null; 70 var peoplePage = null;
71 var browserProxy = null; 71 var browserProxy = null;
72 var syncBrowserProxy = null;
72 73
73 suiteSetup(function() { 74 suiteSetup(function() {
74 // Force easy unlock off. Those have their own ChromeOS-only tests. 75 // Force easy unlock off. Those have their own ChromeOS-only tests.
75 loadTimeData.overrideValues({ 76 loadTimeData.overrideValues({
76 easyUnlockAllowed: false, 77 easyUnlockAllowed: false,
77 }); 78 });
78 }); 79 });
79 80
80 setup(function() { 81 setup(function() {
81 browserProxy = new TestProfileInfoBrowserProxy(); 82 browserProxy = new TestProfileInfoBrowserProxy();
82 settings.ProfileInfoBrowserProxyImpl.instance_ = browserProxy; 83 settings.ProfileInfoBrowserProxyImpl.instance_ = browserProxy;
83 84
85 syncBrowserProxy = new TestSyncBrowserProxy();
86 settings.SyncBrowserProxyImpl.instance_ = syncBrowserProxy;
87
84 PolymerTest.clearBody(); 88 PolymerTest.clearBody();
85 peoplePage = document.createElement('settings-people-page'); 89 peoplePage = document.createElement('settings-people-page');
86 document.body.appendChild(peoplePage); 90 document.body.appendChild(peoplePage);
87 }); 91 });
88 92
89 teardown(function() { peoplePage.remove(); }); 93 teardown(function() { peoplePage.remove(); });
90 94
91 test('GetProfileInfo', function() { 95 test('GetProfileInfo', function() {
92 return browserProxy.whenCalled('getProfileInfo').then(function() { 96 return Promise.all([browserProxy.whenCalled('getProfileInfo'),
97 syncBrowserProxy.whenCalled('getSyncStatus')])
98 .then(function() {
93 Polymer.dom.flush(); 99 Polymer.dom.flush();
94 assertEquals(browserProxy.fakeProfileInfo.name, 100 assertEquals(browserProxy.fakeProfileInfo.name,
95 peoplePage.$$('#profile-name').textContent.trim()); 101 peoplePage.$$('#profile-name').textContent.trim());
96 var bg = peoplePage.$$('#profile-icon').style.backgroundImage; 102 var bg = peoplePage.$$('#profile-icon').style.backgroundImage;
97 assertTrue(bg.includes(browserProxy.fakeProfileInfo.iconUrl)); 103 assertTrue(bg.includes(browserProxy.fakeProfileInfo.iconUrl));
98 104
99 cr.webUIListenerCallback( 105 cr.webUIListenerCallback(
100 'profile-info-changed', 106 'profile-info-changed',
101 {name: 'pushedName', iconUrl: 'http://pushed-url/'}); 107 {name: 'pushedName', iconUrl: 'http://pushed-url/'});
102 108
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 260 }
255 261
256 return { 262 return {
257 registerTests: function() { 263 registerTests: function() {
258 registerProfileInfoTests(); 264 registerProfileInfoTests();
259 if (!cr.isChromeOS) 265 if (!cr.isChromeOS)
260 registerSyncStatusTests(); 266 registerSyncStatusTests();
261 }, 267 },
262 }; 268 };
263 }); 269 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/people_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698