Commit 11b11cef authored by Jesse Schettler's avatar Jesse Schettler Committed by Chromium LUCI CQ

scanning: Change default file type to PDF

Bug: 1059779
Change-Id: Iee421f4a2719abaec71d837c68f26aae88aa255a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2582528Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835719}
parent dc838412
......@@ -34,7 +34,7 @@ export function fileTypeSelectTest() {
test('initializeFileTypeSelect', () => {
// The dropdown should be initialized as enabled with three options. The
// default option should be PNG.
// default option should be PDF.
const select =
/** @type {!HTMLSelectElement} */ (fileTypeSelect.$$('select'));
assertTrue(!!select);
......@@ -43,7 +43,7 @@ export function fileTypeSelectTest() {
assertEquals('JPG', select.options[0].textContent.trim());
assertEquals('PNG', select.options[1].textContent.trim());
assertEquals('PDF', select.options[2].textContent.trim());
assertEquals(FileType.PNG.toString(), select.value);
assertEquals(FileType.PDF.toString(), select.value);
// Selecting a different option should update the selected value.
return changeSelect(
......
......@@ -263,9 +263,6 @@ export function scanningAppTest() {
/** @type {?CrButtonElement} */
let cancelButton = null;
/** @type {?HTMLElement} */
let statusText = null;
/** @type {?HTMLElement} */
let helperText = null;
......@@ -316,7 +313,6 @@ export function scanningAppTest() {
resolutionSelect = null;
scanButton = null;
cancelButton = null;
statusText = null;
helperText = null;
scanProgress = null;
progressText = null;
......@@ -407,8 +403,6 @@ export function scanningAppTest() {
/** @type {!CrButtonElement} */ (scanningApp.$$('#scanButton'));
cancelButton =
/** @type {!CrButtonElement} */ (scanningApp.$$('#cancelButton'));
statusText =
/** @type {!HTMLElement} */ (scanningApp.$$('#statusText'));
helperText = scanningApp.$$('#scanPreview').$$('#helperText');
scanProgress = scanningApp.$$('#scanPreview').$$('#scanProgress');
progressText = scanningApp.$$('#scanPreview').$$('#progressText');
......@@ -423,7 +417,7 @@ export function scanningAppTest() {
// if it exists.
assertEquals(
firstCapabilities.sources[1].name, scanningApp.selectedSource);
assertEquals(FileType.PNG.toString(), scanningApp.selectedFileType);
assertEquals(FileType.PDF.toString(), scanningApp.selectedFileType);
assertEquals(
firstCapabilities.colorModes[0].toString(),
scanningApp.selectedColorMode);
......@@ -446,7 +440,6 @@ export function scanningAppTest() {
assertTrue(isVisible(/** @type {!CrButtonElement} */ (scanButton)));
assertFalse(
isVisible(/** @type {!CrButtonElement} */ (cancelButton)));
assertEquals('', statusText.textContent.trim());
assertTrue(isVisible(/** @type {!HTMLElement} */ (helperText)));
assertFalse(isVisible(/** @type {!HTMLElement} */ (scanProgress)));
assertFalse(isVisible(
......
......@@ -9,10 +9,9 @@
aria-labelledby="fileTypeLabel">
<!-- The option values must match the chromeos.scanning.mojom.FileType
values they correspond to. -->
<!-- TODO(jschettler): Change default back to PDF when it's supported. -->
<option value="0">[[i18n('jpgOptionText')]]</option>
<option value="2" selected>[[i18n('pngOptionText')]]</option>
<option value="1">[[i18n('pdfOptionText')]]</option>
<option value="2">[[i18n('pngOptionText')]]</option>
<option value="1" selected>[[i18n('pdfOptionText')]]</option>
</select>
</div>
</scan-settings-section>
......@@ -197,7 +197,6 @@
[[i18n('cancelButtonText')]]
</cr-button>
</div>
<p id="statusText">[[statusText_]]</p>
</template>
<template is="dom-if" if="[[showDoneSection_]]">
<scan-done-section page-number="[[pageNumber_]]"
......
......@@ -141,9 +141,6 @@ Polymer({
computed: 'computePageSizes_(selectedSource)',
},
/** @private {string} */
statusText_: String,
/**
* Determines whether settings should be disabled based on the current app
* state. Settings should be disabled until after the selected scanner's
......@@ -319,11 +316,7 @@ Polymer({
*/
onCapabilitiesReceived_(response) {
this.capabilities_ = response.capabilities;
// TODO(jschettler): Change default file type back to PDF when it's
// supported.
this.selectedFileType = chromeos.scanning.mojom.FileType.kPng.toString();
this.selectedFileType = chromeos.scanning.mojom.FileType.kPdf.toString();
this.setAppState_(AppState.READY);
},
......@@ -371,15 +364,6 @@ Polymer({
return;
}
// TODO(jschettler): Remove this once ScanService supports PDF.
if (this.selectedFileType ==
chromeos.scanning.mojom.FileType.kPdf.toString()) {
this.statusText_ = 'PDF is not a supported file type.';
return;
}
this.statusText_ = '';
const settings = {
'sourceName': this.selectedSource,
'scanToPath': {'path': this.selectedFilePath},
......
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