Commit 6b13e1b5 authored by tommycli's avatar tommycli Committed by Commit bot

MD Settings People: Fix ChromeOS Change Picture arrow keys

The arrow keys now actually select the newly highlighted picture.

BUG=668416
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2623993002
Cr-Commit-Position: refs/heads/master@{#442795}
parent ca7cf349
......@@ -282,6 +282,9 @@ Polymer({
selector.selectPrevious();
} while (this.selectedItem_.hidden);
if (this.selectedItem_.dataset.type != ChangePictureSelectionTypes.FILE)
this.selectImage_(this.selectedItem_);
this.lastSelectedImageType_ = this.selectedItem_.dataset.type;
e.detail.keyboardEvent.preventDefault();
break;
......@@ -294,6 +297,9 @@ Polymer({
selector.selectNext();
} while (this.selectedItem_.hidden);
if (this.selectedItem_.dataset.type != ChangePictureSelectionTypes.FILE)
this.selectImage_(this.selectedItem_);
this.lastSelectedImageType_ = this.selectedItem_.dataset.type;
e.detail.keyboardEvent.preventDefault();
break;
......
......@@ -201,6 +201,14 @@ cr.define('settings_people_page_change_picture', function() {
expectEquals(firstDefaultImage, changePicture.selectedItem_);
expectFalse(settingsCamera.cameraActive);
expectTrue(discardControlBar.hidden);
// Now verify that arrow keys actually select the new image.
browserProxy.resetResolver('selectDefaultImage');
MockInteractions.pressAndReleaseKeyOn(
changePicture.selectedItem_, 39 /* right */);
return browserProxy.whenCalled('selectDefaultImage');
}).then(function(args) {
expectEquals('chrome://foo/2.png', args[0]);
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment