Commit 696967b1 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[run_web_tests] Let virtual tests inherit base tests' image first config

Previously, the behavior that a virtual test failed because of missing
txt result while the base test were passing suprised many developers and
took them much time to find out that the virtual test suite should be
added in LayoutTests/ImageFirstTests.

Change-Id: I03c6893a4aa7468cd4a327e84d1a4195124c45cb
Reviewed-on: https://chromium-review.googlesource.com/1058330
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558549}
parent 489d402f
...@@ -6,18 +6,6 @@ ietestcenter/css3/multicolumn ...@@ -6,18 +6,6 @@ ietestcenter/css3/multicolumn
ietestcenter/css3/grid ietestcenter/css3/grid
http/tests/fullscreen http/tests/fullscreen
tables tables
tables/mozilla/marvin
tables/mozilla/dom
tables/mozilla/collapsing_borders
tables/mozilla/core
tables/mozilla/other
tables/mozilla/bugs
tables/mozilla_expected_failures/marvin
tables/mozilla_expected_failures/dom
tables/mozilla_expected_failures/collapsing_borders
tables/mozilla_expected_failures/core
tables/mozilla_expected_failures/other
tables/mozilla_expected_failures/bugs
fullscreen fullscreen
fonts fonts
css1/font_properties css1/font_properties
...@@ -39,18 +27,12 @@ fast/css/content ...@@ -39,18 +27,12 @@ fast/css/content
fast/css-intrinsic-dimensions fast/css-intrinsic-dimensions
fast/pagination fast/pagination
fast/multicol fast/multicol
fast/multicol/vertical-rl/balancing
fast/multicol/vertical-lr/balancing
fast/dom/Document/CaretRangeFromPoint fast/dom/Document/CaretRangeFromPoint
fast/dom/elementsFromPoint fast/dom/elementsFromPoint
fast/replaced fast/replaced
fast/borders fast/borders
fast/box-sizing fast/box-sizing
fast/block fast/block
fast/block/margin-collapse/block-inside-inline
fast/block/positioning/vertical-rl
fast/block/positioning/auto
fast/block/positioning/vertical-lr
fast/autoresize fast/autoresize
fast/scroll-behavior fast/scroll-behavior
fast/table fast/table
...@@ -74,10 +56,4 @@ external/wpt/html/rendering/non-replaced-elements/the-fieldset-element-0 ...@@ -74,10 +56,4 @@ external/wpt/html/rendering/non-replaced-elements/the-fieldset-element-0
external/wpt/html/rendering/non-replaced-elements/the-hr-element-0 external/wpt/html/rendering/non-replaced-elements/the-hr-element-0
external/wpt/html/rendering/non-replaced-elements/lists external/wpt/html/rendering/non-replaced-elements/lists
virtual/layout_ng/css2.1/20110323 virtual/layout_ng/css2.1/20110323
virtual/layout_ng/fast/block/basic
virtual/layout_ng/fast/block/margin-collapse
virtual/layout_ng/fast/block/float
virtual/layout_ng/external/wpt/css/CSS2/linebox virtual/layout_ng/external/wpt/css/CSS2/linebox
virtual/mojo-loading/fast/table
virtual/disable-spv175/fast/borders
virtual/disable-spv175/fast/multicol
...@@ -273,7 +273,7 @@ class Worker(object): ...@@ -273,7 +273,7 @@ class Worker(object):
else: else:
test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input) test_input.should_run_pixel_test = self._port.should_run_as_pixel_test(test_input)
test_input.should_run_pixel_test_first = ( test_input.should_run_pixel_test_first = (
self._port.should_run_pixel_test_first(test_input)) self._port.should_run_pixel_test_first(test_input.test_name))
def _run_test(self, test_input, shard_name): def _run_test(self, test_input, shard_name):
self._batch_count += 1 self._batch_count += 1
......
...@@ -1754,9 +1754,15 @@ class Port(object): ...@@ -1754,9 +1754,15 @@ class Port(object):
return False return False
return True return True
def should_run_pixel_test_first(self, test_input): def should_run_pixel_test_first(self, test_name):
return any(test_input.test_name.startswith( """Returns true if the directory of the test (or the base test if the
directory) for directory in self._options.image_first_tests) test is virtual) is listed in _options.image_first_tests (which comes
from LayoutTests/ImageFirstTests or the command line).
"""
if any(test_name.startswith(directory) for directory in self._options.image_first_tests):
return True
base = self.lookup_virtual_test_base(test_name)
return base and self.should_run_pixel_test_first(base)
def _build_path(self, *comps): def _build_path(self, *comps):
"""Returns a path from the build directory.""" """Returns a path from the build directory."""
......
...@@ -885,6 +885,23 @@ class PortTest(unittest.TestCase): ...@@ -885,6 +885,23 @@ class PortTest(unittest.TestCase):
'Bug(test) failures/expected/image.html [ WontFix ]\n') 'Bug(test) failures/expected/image.html [ WontFix ]\n')
self.assertTrue(port.skips_test('failures/expected/image.html')) self.assertTrue(port.skips_test('failures/expected/image.html'))
def test_should_run_pixel_test_first(self):
port = self.make_port(port_name='foo')
# pylint: disable=protected-access
port._options.image_first_tests = ['image-first', 'virtual/flag/additional-virtual-image-first']
port.host.filesystem.write_text_file(
'/mock-checkout/third_party/WebKit/LayoutTests/VirtualTestSuites',
json.dumps([
{ "prefix": "flag", "base": "image-first", "args": ["--flag"]},
{ "prefix": "flag", "base": "non-image-first", "args": ["--flag"]}
]))
self.assertTrue(port.should_run_pixel_test_first('image-first/test.html'))
self.assertTrue(port.should_run_pixel_test_first('virtual/flag/image-first/test.html'))
self.assertTrue(port.should_run_pixel_test_first('virtual/flag/additional-virtual-image-first/test.html'))
self.assertFalse(port.should_run_pixel_test_first('non-image-first/test.html'))
self.assertFalse(port.should_run_pixel_test_first('virtual/flag/non-image-first/test.html'))
class NaturalCompareTest(unittest.TestCase): class NaturalCompareTest(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment