Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py

@@class SingleTestRunner:
5555 self._timeout = test_input.timeout
5656 self._worker_name = worker_name
5757 self._test_name = test_input.test_name
 58 self._should_run_pixel_test = test_input.should_run_pixel_test
5859
5960 self._is_reftest = False
6061 self._reference_files = port.reference_files(self._test_name)

@@class SingleTestRunner:
7778 self._port.expected_audio(self._test_name))
7879
7980 def _should_fetch_expected_checksum(self):
 81 if not self._should_run_pixel_test:
 82 return False
8083 return (self._options.pixel_tests and
8184 not (self._options.new_baseline or self._options.reset_results))
8285

Tools/Scripts/webkitpy/layout_tests/controllers/worker.py

@@class Worker(manager_worker_broker.AbstractWorker):
108108 start_time = time.time()
109109 num_tests = 0
110110 for test_input in test_list:
 111 if self._port.driver_name() == "WebKitTestRunner" and self._port.get_option('skip_pixel_test_if_no_baseline') and self._port.get_option('pixel_tests'):
 112 test_input.should_run_pixel_test = (self._port.expected_image(test_input.test_name) != None)
111113 self._run_test(test_input)
112114 num_tests += 1
113115 self._worker_connection.yield_to_broker()

Tools/Scripts/webkitpy/layout_tests/models/test_input.py

@@class TestInput:
3636 ref_file = None
3737 is_mismatch_reftest = None
3838
39  def __init__(self, test_name, timeout):
 39 def __init__(self, test_name, timeout, should_run_pixel_test=True):
4040 """Holds the input parameters for a test.
4141 Args:
4242 test: name of test (not an absolute path!)

@@class TestInput:
4646 """
4747 self.test_name = test_name
4848 self.timeout = timeout
 49 self.should_run_pixel_test = should_run_pixel_test
4950
5051 def __repr__(self):
5152 return "TestInput('%s', %d)" % (self.test_name, self.timeout)

Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

@@def _set_up_derived_options(port, options):
137137 warnings.append("--no-http is ignored since --force is also provided")
138138 options.http = True
139139
 140 if options.skip_pixel_test_if_no_baseline and not options.pixel_tests:
 141 warnings.append("--skip-pixel-test-if-no-baseline is only supported with -p (--pixel-tests)")
 142
140143 return warnings
141144
142145

@@def parse_args(args=None):
273276 optparse.make_option("--no-new-test-results", action="store_false",
274277 dest="new_test_results", default=True,
275278 help="Don't create new baselines when no expected results exist"),
 279 optparse.make_option("--skip-pixel-test-if-no-baseline", action="store_true",
 280 dest="skip_pixel_test_if_no_baseline", help="Do not generate and check pixel result in the case when "
 281 "no image baseline is available for the test."),
276282 optparse.make_option("--skip-failing-tests", action="store_true",
277283 default=False, help="Skip tests that are expected to fail. "
278284 "Note: When using this option, you might miss new crashes "

Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

@@class MainTest(unittest.TestCase):
331331 tests_run = get_tests_run(['--repeat-each', '2'] + tests_to_run, tests_included=True, flatten_batches=True)
332332 self.assertEquals(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html'])
333333
 334 def test_skip_pixel_test_if_no_baseline_option(self):
 335 tests_to_run = ['passes/image.html', 'passes/text.html']
 336 tests_run = get_tests_run(['--skip-pixel-test-if-no-baseline'] + tests_to_run, tests_included=True, flatten_batches=True)
 337 self.assertEquals(tests_run, ['passes/image.html', 'passes/text.html'])
 338
334339 def test_iterations(self):
335340 tests_to_run = ['passes/image.html', 'passes/text.html']
336341 tests_run = get_tests_run(['--iterations', '2'] + tests_to_run, tests_included=True, flatten_batches=True)

Tools/WebKitTestRunner/TestInvocation.cpp

@@TestInvocation::~TestInvocation()
106106
107107void TestInvocation::setIsPixelTest(const std::string& expectedPixelHash)
108108{
 109 if (!expectedPixelHash.length())
 110 return;
109111 m_dumpPixels = true;
110112 m_expectedPixelHash = expectedPixelHash;
111113}