MediaPlayerTest: Improve timestamp logic in testVideoSurfaceResetting
In android.media.cts.MediaPlayerTest#testVideoSurfaceResetting, the
code was assuming that:
1. The media position does not updated between invocations of
MediaPlayer.getCurrentPosition and MediaPlayer.setDisplay().
2. Seeks happen immediately.
These are both false assumptions.
This patch sets a tolerance when comparing the results of
getCurrentPosition(). The tolerance is set to the time for 1.5 frames
of a 15 fps video to elapse.
This patch also waits for the seek complete signal from the media
before continuing with the test. As a consequence, it is able to use
a lower tolerance when comparing the results after the seek.
Change-Id: I528577b5b92162b4c1a1ba81af801846bacd89d2
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
1 file changed