def test_exists(self, test_name):
        """Returns True if the test name refers to an existing test directory or file."""
        # Used by lint_test_expectations.py to determine if an entry refers to a
        # valid test.
        if self.is_wpt_test(test_name):
            # A virtual WPT test must have valid virtual prefix and base.
            if test_name.startswith('virtual/'):
                return bool(self.lookup_virtual_test_base(test_name))
            # Otherwise treat any WPT test as existing regardless of their real
            # existence on the file system.
            # TODO(crbug.com/959958): Actually check existence of WPT tests.
            return True
        return self.test_isfile(test_name) or self.test_isdir(test_name)