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

Side by Side Diff: tools/telemetry/telemetry/png_bitmap_unittest.py

Issue 12294002: Revert 182991 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/telemetry/telemetry/png_bitmap.py ('k') | tools/telemetry/telemetry/possible_browser.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import unittest 4 import unittest
5 5
6 from telemetry import png_bitmap 6 from telemetry import png_bitmap
7 7
8 # This is a simple base64 encoded 2x2 PNG which contains, in order, a single 8 # This is a simple base64 encoded 2x2 PNG which contains, in order, a single
9 # Red, Yellow, Blue, and Green pixel. 9 # Red, Yellow, Blue, and Green pixel.
10 test_png = """ 10 test_png = """
11 iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91 11 iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91
12 JpzAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACx 12 JpzAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACx
13 MBAJqcGAAAABZJREFUCNdj/M/AwPCfgYGB4T/DfwY 13 MBAJqcGAAAABZJREFUCNdj/M/AwPCfgYGB4T/DfwY
14 AHAAD/iOWZXsAAAAASUVORK5CYII= 14 AHAAD/iOWZXsAAAAASUVORK5CYII=
15 """ 15 """
16 16
17 class PngBitmapTest(unittest.TestCase): 17 class PngBitmapTest(unittest.TestCase):
18 def testRead(self): 18 def testRead(self):
19 png = png_bitmap.PngBitmap(test_png) 19 png = png_bitmap.PngBitmap(test_png)
20 20
21 self.assertEquals(2, png.width) 21 self.assertEquals(2, png.width)
22 self.assertEquals(2, png.height) 22 self.assertEquals(2, png.height)
23 23
24 png.GetPixelColor(0, 0).AssertIsRGB(255, 0, 0) 24 png.GetPixelColor(0, 0).AssertIsRGB(255, 0, 0)
25 png.GetPixelColor(1, 1).AssertIsRGB(0, 255, 0) 25 png.GetPixelColor(1, 1).AssertIsRGB(0, 255, 0)
26 png.GetPixelColor(0, 1).AssertIsRGB(0, 0, 255) 26 png.GetPixelColor(0, 1).AssertIsRGB(0, 0, 255)
27 png.GetPixelColor(1, 0).AssertIsRGB(255, 255, 0) 27 png.GetPixelColor(1, 0).AssertIsRGB(255, 255, 0)
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/png_bitmap.py ('k') | tools/telemetry/telemetry/possible_browser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698