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

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

Issue 2623993002: MD Settings People: Fix ChromeOS Change Picture arrow keys (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into 366-settings-fix-chang… Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/people_page/change_picture.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_change_picture', function() { 5 cr.define('settings_people_page_change_picture', function() {
6 /** 6 /**
7 * @constructor 7 * @constructor
8 * @implements {settings.ChangePictureBrowserProxy} 8 * @implements {settings.ChangePictureBrowserProxy}
9 * @extends {settings.TestBrowserProxy} 9 * @extends {settings.TestBrowserProxy}
10 */ 10 */
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 return browserProxy.whenCalled('selectDefaultImage').then( 194 return browserProxy.whenCalled('selectDefaultImage').then(
195 function(args) { 195 function(args) {
196 expectEquals('chrome://foo/1.png', args[0]); 196 expectEquals('chrome://foo/1.png', args[0]);
197 197
198 Polymer.dom.flush(); 198 Polymer.dom.flush();
199 expectEquals(ChangePictureSelectionTypes.DEFAULT, 199 expectEquals(ChangePictureSelectionTypes.DEFAULT,
200 changePicture.selectedItem_.dataset.type); 200 changePicture.selectedItem_.dataset.type);
201 expectEquals(firstDefaultImage, changePicture.selectedItem_); 201 expectEquals(firstDefaultImage, changePicture.selectedItem_);
202 expectFalse(settingsCamera.cameraActive); 202 expectFalse(settingsCamera.cameraActive);
203 expectTrue(discardControlBar.hidden); 203 expectTrue(discardControlBar.hidden);
204
205 // Now verify that arrow keys actually select the new image.
206 browserProxy.resetResolver('selectDefaultImage');
207 MockInteractions.pressAndReleaseKeyOn(
208 changePicture.selectedItem_, 39 /* right */);
209 return browserProxy.whenCalled('selectDefaultImage');
210 }).then(function(args) {
211 expectEquals('chrome://foo/2.png', args[0]);
204 }); 212 });
205 }); 213 });
206 214
207 test('ChangePictureRestoreImageAfterDiscard', function() { 215 test('ChangePictureRestoreImageAfterDiscard', function() {
208 var firstDefaultImage = changePicture.$$('img[data-type="default"]'); 216 var firstDefaultImage = changePicture.$$('img[data-type="default"]');
209 assertTrue(!!firstDefaultImage); 217 assertTrue(!!firstDefaultImage);
210 var discardOldImage = changePicture.$.discardOldImage; 218 var discardOldImage = changePicture.$.discardOldImage;
211 assertTrue(!!discardOldImage); 219 assertTrue(!!discardOldImage);
212 220
213 MockInteractions.tap(firstDefaultImage); 221 MockInteractions.tap(firstDefaultImage);
(...skipping 16 matching lines...) Expand all
230 }); 238 });
231 }); 239 });
232 } 240 }
233 241
234 return { 242 return {
235 registerTests: function() { 243 registerTests: function() {
236 registerChangePictureTests(); 244 registerChangePictureTests();
237 }, 245 },
238 }; 246 };
239 }); 247 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/change_picture.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698