AudioService: Finish SnooperNode tests + timing bug fix.

Provides missing testing of key functionality, cleans-up existing tests
somewhat to improve readability and robustness, resolves run-time
performance issues, and improves debugging facilities. As a result, a
timing bug was also discovered and fixed in this change. 😃

1. Added a "dump to WAV file" function, activated via a command-line
switch, to aid in confirming test correctness and otherwise debugging
future issues. This allows developers to visualize the audio signal with
an external editor.

2. By using #1, I came to a better understanding of the sources of
timing and resolution error. Thus, certain test issues were better
accounted for, and documented in the code.

3. Fixed timing bug in SnooperNode: The recently-added
SuggestLatestRenderTime() method needed to also account for the pre-
bufferred audio in the resampler.

Bug: 934770, 842428
Change-Id: Ieb1638a9cd4b1703ed0325cd6cf365646db6b1e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1513045
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Max Morin <maxmorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640185}
6 files changed