scanapp: Parse scanner name from USB descriptors

The expected scanner name is currently hardcoded, which has been fine
because all the tests load the same set of USB descriptors.  We want to
add a new test that uses a different descriptor, so the printer name
will be different.  Since the name is fully derived from the USB string
descriptors and we're already parsing the file to get VID and PID out,
switch to getting the printable name out of the file as well.

BUG=b:199521284
TEST=tast run '("dep:virtual_usb_printer")'

Change-Id: I633cfe4e810c9688fae76a98cc944d58f1993a4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/3611986
Commit-Queue: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Matt Stark <msta@google.com>
Reviewed-by: Paul Moy <pmoy@chromium.org>
Tested-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: David Welling <davidwelling@google.com>
6 files changed
tree: 63485f577d4b835c43465f3858bf711e355f3293
  1. android/
  2. helpers/
  3. src/
  4. tools/
  5. vars/
  6. .gitignore
  7. LICENSE
  8. OWNERS
  9. PRESUBMIT.cfg
  10. PRESUBMIT.py
  11. README.md
  12. unblocked_terms.txt
README.md

Tast (tests)

This repository contains integration tests that are run by Tast.

Directory structure

  • helpers/ - Source code for binaries executed by tests.
    • local/ - Helpers for local tests that are compiled and installed to /usr/local/libexec/tast/helpers/local/cros by the tast-local-helpers-cros package.
  • src/chromiumos/tast/
    • local/ - Code related to local (i.e. on-device or “client”) tests.
      • bundles/ - Local test bundles.
        • cros/ - The “cros” local test bundle, containing standard Chrome OS tests. Tests are packaged by category.
      • ... - Packages used only by local tests.
    • remote/ - Code related to remote (i.e. off-device or “server”) tests.
      • bundles/ - Remote test bundles.
        • cros/ - The “cros” remote test bundle, containing standard Chrome OS tests. Tests are packaged by category.
      • ... - Packages used only by remote tests.

Shared code, the main tast executable, the local_test_runner and remote_test_runner executables responsible for running bundles, and documentation are located in the tast repository.

GoDoc