Reset only invalid custom margins.

BUG=332183

Review URL: https://codereview.chromium.org/131013005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244086 0039d316-1c4b-4281-b951-d872f2087c98
parent 24754fe9
......@@ -423,10 +423,11 @@ cr.define('print_preview', function() {
cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
} else {
// Reset user selection for certain ticket items.
this.customMargins_.updateValue(null);
if (this.marginsType_.getValue() ==
print_preview.ticket_items.MarginsType.Value.CUSTOM) {
print_preview.ticket_items.MarginsType.Value.CUSTOM &&
!this.customMargins_.wouldValueBeValid(
this.customMargins_.getValue())) {
this.customMargins_.updateValue(null);
this.marginsType_.updateValue(
print_preview.ticket_items.MarginsType.Value.DEFAULT);
}
......
......@@ -722,7 +722,7 @@ TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() {
var previewGenerator = mock(print_preview.PreviewGenerator);
printPreview.previewArea_.previewGenerator_ = previewGenerator.proxy();
previewGenerator.expects(exactly(6)).requestPreview();
previewGenerator.expects(atLeastOnce()).requestPreview();
var barDestination;
var destinations = printPreview.destinationStore_.destinations;
......
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