| Index: tools/telemetry/telemetry/core/video_unittest.py
|
| diff --git a/tools/telemetry/telemetry/core/video_unittest.py b/tools/telemetry/telemetry/core/video_unittest.py
|
| index b49190d106d78006322214b926d1db1ef7b06073..e940f0f49e4d4f490dda76deb8126a4227a1e5c4 100644
|
| --- a/tools/telemetry/telemetry/core/video_unittest.py
|
| +++ b/tools/telemetry/telemetry/core/video_unittest.py
|
| @@ -2,19 +2,30 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| +import logging
|
| import os
|
| import unittest
|
|
|
| -from telemetry import decorators
|
| +from telemetry import benchmark
|
| from telemetry.core import bitmap
|
| +from telemetry.core import platform
|
| from telemetry.core import util
|
| from telemetry.core import video
|
|
|
|
|
| class VideoTest(unittest.TestCase):
|
|
|
| - @decorators.Enabled('linux')
|
| + @benchmark.Disabled
|
| def testFramesFromMp4(self):
|
| + host_platform = platform.GetHostPlatform()
|
| +
|
| + try:
|
| + host_platform.InstallApplication('avconv')
|
| + finally:
|
| + if not host_platform.CanLaunchApplication('avconv'):
|
| + logging.warning('Test not supported on this platform')
|
| + return # pylint: disable=W0150
|
| +
|
| vid = os.path.join(util.GetUnittestDataDir(), 'vid.mp4')
|
| expected_timestamps = [
|
| 0,
|
| @@ -27,14 +38,13 @@
|
| 1926,
|
| ]
|
|
|
| - with open(vid) as video_file:
|
| - video_obj = video.Video(video_file)
|
| + video_obj = video.Video(vid)
|
|
|
| - # Calling _FramesFromMp4 should return all frames.
|
| - # pylint: disable=W0212
|
| - for i, timestamp_bitmap in enumerate(video_obj._FramesFromMp4()):
|
| - timestamp, bmp = timestamp_bitmap
|
| - self.assertEquals(timestamp, expected_timestamps[i])
|
| - expected_bitmap = bitmap.Bitmap.FromPngFile(os.path.join(
|
| - util.GetUnittestDataDir(), 'frame%d.png' % i))
|
| - self.assertTrue(expected_bitmap.IsEqual(bmp))
|
| + # Calling _FramesFromMp4 should return all frames.
|
| + # pylint: disable=W0212
|
| + for i, timestamp_bitmap in enumerate(video_obj._FramesFromMp4(vid)):
|
| + timestamp, bmp = timestamp_bitmap
|
| + self.assertEquals(timestamp, expected_timestamps[i])
|
| + expected_bitmap = bitmap.Bitmap.FromPngFile(os.path.join(
|
| + util.GetUnittestDataDir(), 'frame%d.png' % i))
|
| + self.assertTrue(expected_bitmap.IsEqual(bmp))
|
|
|