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