Refactor DecoderTest

This change is identical in functionality to the previous code, but
makes it easier to reuse code for future tests.

b/8543366

Change-Id: If308c2337acc17854b897099528264522d83083b
1 file changed