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

3232class TestInput:
3333 """Groups information about a test for easy passing of data."""
3434
35  def __init__(self, test_name, timeout):
 35 def __init__(self, test_name, timeout, ref_file=None, is_mismatch=False):
3636 """Holds the input parameters for a test.
3737 Args:
3838 test: name of test (not an absolute path!)

4040 """
4141 self.test_name = test_name
4242 self.timeout = timeout
 43 self.ref_file = ref_file
 44 self.is_mismatch = is_mismatch
4345
4446 def __repr__(self):
4547 return "TestInput('%s', %d)" % (self.test_name, self.timeout)
99141

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

316316 # This maps worker names to the state we are tracking for each of them.
317317 self._worker_states = {}
318318
 319 def _parse_reftest_tests(self):
 320 """Parse all reftests.list in tests' directories and populate self._reftests
 321
 322 Args:
 323 tests: list of tests for which references may be parsed
 324 """
 325
 326 self._reftest_list = {}
 327 test_dirs = set()
 328 for path in self._test_files:
 329 test_dir = self._fs.dirname(path)
 330 if test_dir in test_dirs:
 331 continue
 332 test_dirs.add(test_dir)
 333 reftest_list_path = self._fs.join(self._port.path_from_webkit_base('LayoutTests'), test_dir, 'reftest.list')
 334 if self._fs.exists(reftest_list_path):
 335 for line in self._fs.read_text_file(reftest_list_path).split('\n'):
 336 split_line = line.split()
 337 if len(split_line) < 3:
 338 continue
 339 expectation_type, test_file, ref_file = split_line[0], split_line[1], split_line[2]
 340 ref_file_path = self._fs.join(test_dir, ref_file)
 341 self._reftest_list[self._fs.join(test_dir, test_file)] = (expectation_type, ref_file_path)
 342
 343 # Don't treat reference files as test files
 344 for expectation_type, ref_file_path in self._reftest_list.values():
 345 if ref_file_path in self._test_files:
 346 self._test_files.remove(ref_file_path)
 347
319348 def collect_tests(self, args):
320349 """Find all the files to test.
321350

326355 paths = self._strip_test_dir_prefixes(args)
327356 if self._options.test_list:
328357 paths += self._strip_test_dir_prefixes(read_test_files(self._fs, self._options.test_list, self._port.TEST_PATH_SEPARATOR))
 358
329359 self._test_files = self._port.tests(paths)
 360 self._parse_reftest_tests()
330361
 362
331363 def _strip_test_dir_prefixes(self, paths):
332364 return [self._strip_test_dir_prefix(path) for path in paths if path]
333365

544576 """Returns the appropriate TestInput object for the file. Mostly this
545577 is used for looking up the timeout value (in ms) to use for the given
546578 test."""
 579 if test_file in self._reftest_list:
 580 is_mismatch = self._reftest_list[test_file][0] == '!='
 581 ref_file = self._reftest_list[test_file][1]
 582 else:
 583 is_mismatch = False
 584 ref_file = None
547585 if self._test_is_slow(test_file):
548  return TestInput(test_file, self._options.slow_time_out_ms)
549  return TestInput(test_file, self._options.time_out_ms)
 586 return TestInput(test_file, self._options.slow_time_out_ms, ref_file, is_mismatch)
 587 return TestInput(test_file, self._options.time_out_ms, ref_file, is_mismatch)
550588
551589 def _test_requires_lock(self, test_file):
552590 """Return True if the test needs to be locked when
99141