chameleond: v3: WaitVideoInputStable timeout should return False

The returns contract of WaitVideoInputStable states it should return
False on a timeout. We were raising a subprocess exception instead.
Let's fix that!

Also adjust utils/screenshot to show when there's an error instead of
happly continuing with a screenshot (which will probably hang).

BUG=b/229786564
TEST=python client/test_server.py --chameleon_host localhost
>>> p.WaitVideoInputStable(2, 10)
False # No more exception!
TEST=% ./utils/screenshot --chameleon_host localhost --port_id=2 && gwenview image.png
Use port 2: ITE_HDMI1
Plugging... Wait for input stable... Unplugging to the original state...
Traceback (most recent call last):
  File "/home/amstan/cros/src/platform/chameleon/./utils/screenshot", line 148, in <module>
    main()
  File "/home/amstan/cros/src/platform/chameleon/./utils/screenshot", line 119, in main
    raise Exception("Timeout while WaitVideoInputStable()")
Exception: Timeout while WaitVideoInputStable()

Change-Id: I77274586efd6c20b2b3b688d248c1b84bce682ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/chameleon/+/3625990
Tested-by: Alexandru Stan <amstan@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Auto-Submit: Alexandru Stan <amstan@chromium.org>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
2 files changed