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

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

Issue 103723002: [Telemetry] Convert mp4 video to Timestamp+Bitmaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bulach+szym comments Created 7 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
Index: tools/telemetry/telemetry/core/bitmap_unittest.py
diff --git a/tools/telemetry/telemetry/core/bitmap_unittest.py b/tools/telemetry/telemetry/core/bitmap_unittest.py
index 45dd14fdcf4d18216ff5cca238b159dcb0bb144c..4d37e1490ad98b7337aa61d2439a6495d2d844a4 100644
--- a/tools/telemetry/telemetry/core/bitmap_unittest.py
+++ b/tools/telemetry/telemetry/core/bitmap_unittest.py
@@ -2,8 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import unittest
+import tempfile
import os
+import unittest
from telemetry.core import bitmap
from telemetry.core import util
@@ -35,7 +36,7 @@ class BitmapTest(unittest.TestCase):
bmp.GetPixelColor(0, 1).AssertIsRGB(0, 0, 255)
bmp.GetPixelColor(1, 0).AssertIsRGB(255, 255, 0)
- def testReadFromPnfFile(self):
+ def testReadFromPngFile(self):
file_bmp = bitmap.Bitmap.FromPngFile(test_png_path)
self.assertEquals(2, file_bmp.width)
@@ -46,6 +47,13 @@ class BitmapTest(unittest.TestCase):
file_bmp.GetPixelColor(0, 1).AssertIsRGB(0, 0, 255)
file_bmp.GetPixelColor(1, 0).AssertIsRGB(255, 255, 0)
+ def testWritePngFile(self):
+ orig = bitmap.Bitmap.FromPngFile(test_png_path)
+ temp_file = tempfile.NamedTemporaryFile().name
+ orig.WritePngFile(temp_file)
+ new_file = bitmap.Bitmap.FromPngFile(temp_file)
+ self.assertTrue(orig.IsEqual(new_file))
+
def testIsEqual(self):
bmp = bitmap.Bitmap.FromBase64Png(test_png)
file_bmp = bitmap.Bitmap.FromPngFile(test_png_path)
« no previous file with comments | « tools/telemetry/telemetry/core/bitmap.py ('k') | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698