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

Unified Diff: webkit/tools/layout_tests/test_types/test_type_base.py

Issue 10926: Place all new baseline files in the most specific platform directory.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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: webkit/tools/layout_tests/test_types/test_type_base.py
===================================================================
--- webkit/tools/layout_tests/test_types/test_type_base.py (revision 5432)
+++ webkit/tools/layout_tests/test_types/test_type_base.py (working copy)
@@ -20,13 +20,9 @@
class TestArguments(object):
"""Struct-like wrapper for additional arguments needed by specific tests."""
- # Outer directory in which to place new baseline results.
- new_baseline = None
+ # Whether to save new baseline results.
+ new_baseline = False
- # Whether to save new text baseline files (otherwise only save image
- # results as a new baseline).
- text_baseline = False
-
# Path to the actual PNG file generated by pixel tests
png_path = None
@@ -63,27 +59,27 @@
path_utils.RelativeTestFilename(filename))
google.path_utils.MaybeMakeDirectory(os.path.split(output_filename)[0])
- def _SaveBaselineData(self, filename, dest_dir, data, modifier):
- """Saves a new baseline file.
+ def _SaveBaselineData(self, filename, data, modifier):
+ """Saves a new baseline file into the platform directory.
The file will be named simply "<test>-expected<modifier>", suitable for
use as the expected results in a later run.
Args:
- filename: the test filename
- dest_dir: the outer directory into which the results should be saved.
- The subdirectory corresponding to this test will be created if
- necessary.
+ filename: path to the test file
data: result to be saved as the new baseline
modifier: type of the result file, e.g. ".txt" or ".png"
"""
- output_filename = os.path.join(dest_dir,
- path_utils.RelativeTestFilename(filename))
- output_filename = (os.path.splitext(output_filename)[0] +
- self.FILENAME_SUFFIX_EXPECTED + modifier)
- google.path_utils.MaybeMakeDirectory(os.path.split(output_filename)[0])
- open(output_filename, "wb").write(data)
+ relative_dir = os.path.dirname(path_utils.RelativeTestFilename(filename))
+ output_dir = os.path.join(path_utils.PlatformResultsDir(self._platform),
+ self._platform,
+ relative_dir)
+ output_file = os.path.basename(os.path.splitext(filename)[0] +
+ self.FILENAME_SUFFIX_EXPECTED + modifier)
+ google.path_utils.MaybeMakeDirectory(output_dir)
+ open(os.path.join(output_dir, output_file), "wb").write(data)
+
def OutputFilename(self, filename, modifier):
"""Returns a filename inside the output dir that contains modifier.

Powered by Google App Engine
This is Rietveld 408576698