DO NOT MERGE Accommodate limitations of CTS web server

This is a backport of the fix for b/37276299, for [KL]-* branches. The
functionality is already in M+ branches.

When we handle streaming media and need to jump ahead into the stream,
we start a new request using the HTTP "Range" specification to indicate
where in the media to start serving.  Unfortunately, our embedded CTS
web server does NOT support this construct.

Recent changes to our Media security tests have us try media both as a
local file and as a stream from the local CTS web server. This gives us
better coverage and the stream version was required to trigger a
particular security bug (before we fixed the bug).

One of the other test cases that has been added recently has the
media framework code hopping around in the file to parse particular
atrributes (in this case, it's a MIDI file and we're trying to get
at the meta data). This hopping triggers some of those "Range" requests
and things get bad at that point.

These changes wrap the client side of our code so that if we are for
some reason unable to set up the media extractor with the streaming
source from the CTS web server, we treat it as test harness flakiness
instead of declaring that the test failed.

An eventual goal would be to rework the CTSTestServer so that it
supports the Range headers; but that's for another day.

Bug: 37542937
Bug: 38391487
Test: CTS build, ran CTS with oc-dev version of this patch.
Change-Id: I4efb9a39936e81a4614f040c2d9b25fffa53b868
Merged-In: I7745c67e1d11adc9d8454ed7705e33d2fdbdd882
(cherry picked from commit c653b2b9516e1c1d18da35f43db206d71c3f0d7c)
1 file changed