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

Side by Side Diff: content/test/gpu/gpu_tests/pixel.py

Issue 668753002: [Telemetry] Migrate bitmap.py from bitmaptools.cc to numpy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make GetBoundingBox just, like, WAY too fast Created 6 years, 2 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
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 from datetime import datetime 4 from datetime import datetime
5 import glob 5 import glob
6 import optparse 6 import optparse
7 import os 7 import os
8 import re 8 import re
9 9
10 import cloud_storage_test_base 10 import cloud_storage_test_base
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if not cur_revision: 127 if not cur_revision:
128 cur_revision = 0 128 cur_revision = 0
129 129
130 image_path = os.path.join(img_dir, img_name) 130 image_path = os.path.join(img_dir, img_name)
131 131
132 self._DeleteOldReferenceImages(image_path, cur_revision) 132 self._DeleteOldReferenceImages(image_path, cur_revision)
133 133
134 image_path = image_path + '_' + str(cur_revision) + '.png' 134 image_path = image_path + '_' + str(cur_revision) + '.png'
135 135
136 try: 136 try:
137 ref_png = bitmap.Bitmap.FromPngFile(image_path) 137 ref_png = bitmap.Bitmap.FromImageFile(image_path)
138 except IOError: 138 except IOError:
139 ref_png = None 139 ref_png = None
140 140
141 if ref_png: 141 if ref_png:
142 return ref_png 142 return ref_png
143 143
144 print 'Reference image not found. Writing tab contents as reference.' 144 print 'Reference image not found. Writing tab contents as reference.'
145 145
146 self._WriteImage(image_path, screenshot) 146 self._WriteImage(image_path, screenshot)
147 return screenshot 147 return screenshot
(...skipping 10 matching lines...) Expand all
158 default=default_reference_image_dir) 158 default=default_reference_image_dir)
159 159
160 def CreatePageSet(self, options): 160 def CreatePageSet(self, options):
161 page_set = page_sets.PixelTestsPageSet() 161 page_set = page_sets.PixelTestsPageSet()
162 for page in page_set.pages: 162 for page in page_set.pages:
163 page.script_to_evaluate_on_commit = test_harness_script 163 page.script_to_evaluate_on_commit = test_harness_script
164 return page_set 164 return page_set
165 165
166 def CreateExpectations(self): 166 def CreateExpectations(self):
167 return pixel_expectations.PixelExpectations() 167 return pixel_expectations.PixelExpectations()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698