[cc/metrics] Make it easier to write tests.

Add a helper function GenerateSequence() to make it easier to write
tests that need to issue a series of commands for a sequence of frames.
With this function, it should be possible to write tests for any
sequences that hit any of the DCHECK()s in this code.

Add a couple of simple tests with this new function.

BUG=1034103

Change-Id: I61f2e22ca69f9d2cfb1e09b1e42a18d4c44e429d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1979767
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Xida Chen <xidachen@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727077}
1 file changed