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