Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: tools/telemetry/telemetry/core/video_unittest.py

Issue 748873003: Revert of [Telemetry] Fix video_unittest so that it actually runs on bots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/video.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « tools/telemetry/telemetry/core/video.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698