Skip to content

Commit

Permalink
[run-webkit-tests] Let --reset-results reset flag-specific baselines
Browse files Browse the repository at this point in the history
If --additional-driver-flag is specified, it was weird to still let
--reset-results reset the existing baselines. There seems no use case
for that.

Now let --reset-results reset flag-specific baselines if --additional-
driver-flag is specified.

Bug: 660231
Change-Id: I6ee5a5f563a7f972fcece763256d7f99f3e97cbe
Reviewed-on: https://chromium-review.googlesource.com/740841
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512061}
  • Loading branch information
wangxianzhu authored and Commit Bot committed Oct 27, 2017
1 parent 17b517d commit 5ca1d27
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/testing/layout_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ doesn't support rebaselining flag-specific expectations.

```bash
cd src/third_party/WebKit
Tools/Script/run-webkit-tests --additional-driver-flag=--enable-flag --copy-baselines --reset-results foo/bar/test.html
Tools/Script/run-webkit-tests --additional-driver-flag=--enable-flag --reset-results foo/bar/test.html
```

New baselines will be created in the flag-specific baselines directory, e.g.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,11 @@ def _save_baseline_data(self, data, extension):
port = self._port
fs = self._filesystem

if self._options.copy_baselines:
flag_specific_dir = port.baseline_flag_specific_dir()
if flag_specific_dir:
output_dir = fs.join(flag_specific_dir, fs.dirname(self._test_name))
else:
output_dir = fs.join(port.baseline_version_dir(), fs.dirname(self._test_name))
flag_specific_dir = port.baseline_flag_specific_dir()
if flag_specific_dir:
output_dir = fs.join(flag_specific_dir, fs.dirname(self._test_name))
elif self._options.copy_baselines:
output_dir = fs.join(port.baseline_version_dir(), fs.dirname(self._test_name))
else:
output_dir = fs.dirname(port.expected_filename(self._test_name, extension))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def parse_args(args):
action='store_true',
default=False,
help=('Reset baselines to the generated results in their existing location. '
'If --additional-driver-flag is specific, reset the flag-specific baselines. '
'If --copy-baselines is specified, the copied baselines will be reset.')),
optparse.make_option(
'--results-directory',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,6 @@ def test_new_flag_specific_baseline(self):
'text-image-checksum_fail-txt')
details, log_stream, _ = logging_run(
['--additional-driver-flag=--flag',
'--copy-baselines',
'--reset-results',
'failures/unexpected/text-image-checksum.html'],
tests_included=True, host=host)
Expand Down Expand Up @@ -1319,7 +1318,6 @@ def test_new_flag_specific_baseline_optimize(self):

details, log_stream, _ = logging_run(
['--additional-driver-flag=--flag',
'--copy-baselines',
'--reset-results',
'failures/unexpected/text-image-checksum.html'],
tests_included=True, host=host)
Expand Down

0 comments on commit 5ca1d27

Please sign in to comment.