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

Unified Diff: tools/tests/render_pictures_test.py

Issue 289063010: make render_pictures properly handle empty expectations file (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added some comments Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« tools/image_expectations.cpp ('K') | « tools/image_expectations.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tests/render_pictures_test.py
diff --git a/tools/tests/render_pictures_test.py b/tools/tests/render_pictures_test.py
index 5ab9d673bb605477c2bd2f4e1859f254328553f0..1d08eb90e05e15ba35fe6ee3fd9a5185ed38dbe1 100755
--- a/tools/tests/render_pictures_test.py
+++ b/tools/tests/render_pictures_test.py
@@ -269,6 +269,37 @@ class RenderPicturesTest(base_unittest.TestCase):
self._assert_directory_contents(
write_path_dir, ['red_skp.png', 'green_skp.png'])
+ def test_untiled_empty_expectations_file(self):
scroggo 2014/05/19 13:28:32 It looks like this function could share code with
epoger 2014/05/19 14:52:00 Good idea. I took a stab at this; please let me k
scroggo 2014/05/19 15:07:38 Looks good.
+ """Same as test_untiled, but with an empty expectations file."""
+ output_json_path = os.path.join(self._output_dir, 'actuals.json')
+ write_path_dir = self.create_empty_dir(
+ path=os.path.join(self._output_dir, 'writePath'))
+ self._generate_skps()
+ expectations_path = os.path.join(self._expectations_dir, 'empty')
+ with open(expectations_path, 'w') as fh:
+ pass
+ self._run_render_pictures([
+ '-r', self._input_skp_dir,
+ '--readJsonSummaryPath', expectations_path,
+ '--writePath', write_path_dir,
+ '--writeJsonSummaryPath', output_json_path])
+ expected_summary_dict = {
+ "header" : EXPECTED_HEADER_CONTENTS,
+ "actual-results" : {
+ "red.skp": {
+ "whole-image": modified_dict(
+ RED_WHOLEIMAGE, {"comparisonResult" : "no-comparison"}),
+ },
+ "green.skp": {
+ "whole-image": modified_dict(
+ GREEN_WHOLEIMAGE, {"comparisonResult" : "no-comparison"}),
+ }
+ }
+ }
+ self._assert_json_contents(output_json_path, expected_summary_dict)
+ self._assert_directory_contents(
+ write_path_dir, ['red_skp.png', 'green_skp.png'])
+
def test_untiled_writeChecksumBasedFilenames(self):
"""Same as test_untiled, but with --writeChecksumBasedFilenames."""
output_json_path = os.path.join(self._output_dir, 'actuals.json')
« tools/image_expectations.cpp ('K') | « tools/image_expectations.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698