Commit a49262da authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

scanning: Fix test imports

Import specific functions from scanning_app_test_utils

Import the appropriate Scanning subpage for each test.

Bug: 1059779
Change-Id: I9d0470a8955a892fa3820e55544097576e9c2118
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522111
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: default avatarJesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824731}
parent 251ec79d
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/color_mode_select.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {getColorModeString} from 'chrome://scanning/scanning_app_util.js';
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/file_type_select.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/page_size_select.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {getPageSizeString} from 'chrome://scanning/scanning_app_util.js';
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/resolution_select.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/scan_to_select.js';
import {ScanningBrowserProxyImpl} from 'chrome://scanning/scanning_browser_proxy.js';
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/scanner_select.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {ScannerArr} from 'chrome://scanning/scanning_app_types.js';
......@@ -11,7 +10,7 @@ import {tokenToString} from 'chrome://scanning/scanning_app_util.js';
import {assertEquals, assertFalse, assertTrue} from '../../chai_assert.js';
import * as utils from './scanning_app_test_utils.js';
import {createScanner} from './scanning_app_test_utils.js';
const firstScannerId =
/** @type {!mojoBase.mojom.UnguessableToken} */ ({high: 0, low: 1});
......@@ -49,8 +48,8 @@ export function scannerSelectTest() {
assertFalse(throbber.hidden);
const scannerArr = [
utils.createScanner(firstScannerId, firstScannerName),
utils.createScanner(secondScannerId, secondScannerName)
createScanner(firstScannerId, firstScannerName),
createScanner(secondScannerId, secondScannerName)
];
scannerSelect.scanners = scannerArr;
scannerSelect.loaded = true;
......@@ -71,7 +70,7 @@ export function scannerSelectTest() {
const select = scannerSelect.$$('select');
assertTrue(!!select);
let scannerArr = [utils.createScanner(firstScannerId, firstScannerName)];
let scannerArr = [createScanner(firstScannerId, firstScannerName)];
scannerSelect.scanners = scannerArr;
scannerSelect.loaded = true;
flush();
......@@ -80,8 +79,8 @@ export function scannerSelectTest() {
assertEquals(1, select.length);
assertTrue(select.disabled);
scannerArr = scannerArr.concat(
[utils.createScanner(secondScannerId, secondScannerName)]);
scannerArr =
scannerArr.concat([createScanner(secondScannerId, secondScannerName)]);
scannerSelect.scanners = scannerArr;
flush();
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......@@ -13,7 +12,7 @@ import {tokenToString} from 'chrome://scanning/scanning_app_util.js';
import {assertEquals, assertFalse, assertTrue} from '../../chai_assert.js';
import {flushTasks} from '../../test_util.m.js';
import * as utils from './scanning_app_test_utils.js';
import {createScanner, createScannerSource} from './scanning_app_test_utils.js';
const ColorMode = {
BLACK_AND_WHITE: chromeos.scanning.mojom.ColorMode.kBlackAndWhite,
......@@ -226,21 +225,20 @@ export function scanningAppTest() {
const secondScannerName = 'Scanner 2';
const expectedScanners = [
utils.createScanner(firstScannerId, firstScannerName),
utils.createScanner(secondScannerId, secondScannerName)
createScanner(firstScannerId, firstScannerName),
createScanner(secondScannerId, secondScannerName)
];
const firstCapabilities = {
sources: [
utils.createScannerSource(SourceType.FLATBED, 'platen', pageSizes),
utils.createScannerSource(
SourceType.ADF_DUPLEX, 'adf duplex', pageSizes),
createScannerSource(SourceType.FLATBED, 'platen', pageSizes),
createScannerSource(SourceType.ADF_DUPLEX, 'adf duplex', pageSizes),
],
colorModes: [ColorMode.BLACK_AND_WHITE, ColorMode.COLOR],
resolutions: [75, 100, 300]
};
const secondCapabilities = {
sources: [utils.createScannerSource(
sources: [createScannerSource(
SourceType.ADF_SIMPLEX, 'adf simplex', pageSizes)],
colorModes: [ColorMode.GRAYSCALE],
resolutions: [150, 600]
......
......@@ -4,6 +4,11 @@
// TODO(jschettler): Use es6 module for mojo binding (crbug/1004256).
import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/big_buffer.mojom-lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/string16.mojom-lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import 'chrome://scanning/file_path.mojom-lite.js';
import 'chrome://scanning/scanning.mojom-lite.js';
import {colorModeSelectTest} from './color_mode_select_test.js';
import {fileTypeSelectTest} from './file_type_select_test.js';
......
......@@ -2,15 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'chrome://scanning/scan_preview.js';
import 'chrome://scanning/scanning_app.js';
import 'chrome://scanning/source_select.js';
import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {getSourceTypeString} from 'chrome://scanning/scanning_app_util.js';
import {assertEquals, assertFalse, assertTrue} from '../../chai_assert.js';
import * as utils from './scanning_app_test_utils.js';
import {createScannerSource} from './scanning_app_test_utils.js';
const FileType = {
JPG: chromeos.scanning.mojom.FileType.kJpg,
......@@ -56,9 +55,9 @@ export function sourceSelectTest() {
assertEquals(0, select.length);
const firstSource =
utils.createScannerSource(SourceType.FLATBED, 'platen', pageSizes);
const secondSource = utils.createScannerSource(
SourceType.ADF_SIMPLEX, 'adf simplex', pageSizes);
createScannerSource(SourceType.FLATBED, 'platen', pageSizes);
const secondSource =
createScannerSource(SourceType.ADF_SIMPLEX, 'adf simplex', pageSizes);
const sourceArr = [firstSource, secondSource];
sourceSelect.sources = sourceArr;
flush();
......@@ -81,7 +80,7 @@ export function sourceSelectTest() {
assertTrue(!!select);
let sourceArr =
[utils.createScannerSource(SourceType.FLATBED, 'flatbed', pageSizes)];
[createScannerSource(SourceType.FLATBED, 'flatbed', pageSizes)];
sourceSelect.sources = sourceArr;
flush();
......@@ -89,8 +88,8 @@ export function sourceSelectTest() {
assertEquals(1, select.length);
assertTrue(select.disabled);
sourceArr = sourceArr.concat([utils.createScannerSource(
SourceType.ADF_DUPLEX, 'adf duplex', pageSizes)]);
sourceArr = sourceArr.concat(
[createScannerSource(SourceType.ADF_DUPLEX, 'adf duplex', pageSizes)]);
sourceSelect.sources = sourceArr;
flush();
......
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