AW: run_cts auto-determines device arch

This adds proper logic to run_cts.py to auto-determine the device
architecture, and to throw an error if the device architecture is not
supported. This also adds unit tests (and configures them to run on
presubmit).

Although this is not a significant improvement (we still only support
"arm64"), this gives fast, clear feedback when the device is unsupported
(e.g., emulators), and the logic should generalize as we support more
architectures. This also adds logging (which will be visible with
--verbose, to aid debugging).

This does minor refactoring in the script, to plumb arch where it's used
instead of reassigning to args.arch (which should help with testability
in the future).

R=aluo@chromium.org

Bug: 922854
Test: vpython android_webview/tools/run_cts_test.py
Test: android_webview/tools/run_cts.py (script still runs)
Change-Id: I6528ab836f30b5885ede59853acaeee69de26fa2
Reviewed-on: https://chromium-review.googlesource.com/c/1419840
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625376}
3 files changed