本文整理汇总了Python中webkitpy.common.webkit_finder.WebKitFinder.chromium_base方法的典型用法代码示例。如果您正苦于以下问题:Python WebKitFinder.chromium_base方法的具体用法?Python WebKitFinder.chromium_base怎么用?Python WebKitFinder.chromium_base使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.common.webkit_finder.WebKitFinder
的用法示例。
在下文中一共展示了WebKitFinder.chromium_base方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _read_configuration_from_gn
# 需要导入模块: from webkitpy.common.webkit_finder import WebKitFinder [as 别名]
# 或者: from webkitpy.common.webkit_finder.WebKitFinder import chromium_base [as 别名]
def _read_configuration_from_gn(fs, options):
"""Return the configuration to used based on args.gn, if possible."""
# We should really default to 'out' everywhere at this point, but
# that's a separate cleanup CL.
build_directory = getattr(options, 'build_directory', None) or 'out'
target = options.target
finder = WebKitFinder(fs)
path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn')
if not fs.exists(path):
path = fs.join(finder.chromium_base(), build_directory, target, 'toolchain.ninja')
if not fs.exists(path):
# This does not appear to be a GN-based build directory, so we don't know
# how to interpret it.
return None
# toolchain.ninja exists, but args.gn does not; this can happen when
# `gn gen` is run with no --args.
return 'Debug'
args = fs.read_text_file(path)
for l in args.splitlines():
m = re.match('^\s*is_debug\s*=\s*false(\s*$|\s*#.*$)', l)
if m:
return 'Release'
# if is_debug is set to anything other than false, or if it
# does not exist at all, we should use the default value (True).
return 'Debug'
示例2: _determine_driver_path_statically
# 需要导入模块: from webkitpy.common.webkit_finder import WebKitFinder [as 别名]
# 或者: from webkitpy.common.webkit_finder.WebKitFinder import chromium_base [as 别名]
def _determine_driver_path_statically(cls, host, options):
config_object = config.Config(host.executive, host.filesystem)
build_directory = getattr(options, "build_directory", None)
finder = WebKitFinder(host.filesystem)
webkit_base = finder.webkit_base()
chromium_base = finder.chromium_base()
driver_name = cls.SKY_SHELL_NAME
if hasattr(options, "configuration") and options.configuration:
configuration = options.configuration
else:
configuration = config_object.default_configuration()
return cls._static_build_path(host.filesystem, build_directory, chromium_base, configuration, [driver_name])
示例3: W3CExpectationsLineAdder
# 需要导入模块: from webkitpy.common.webkit_finder import WebKitFinder [as 别名]
# 或者: from webkitpy.common.webkit_finder.WebKitFinder import chromium_base [as 别名]
#.........这里部分代码省略.........
if marker_comment_index == -1:
file_contents += '\n%s\n' % MARKER_COMMENT
file_contents += '\n'.join(line_list)
else:
end_of_marker_line = (file_contents[marker_comment_index:].find('\n')) + marker_comment_index
file_contents = file_contents[:end_of_marker_line + 1] + '\n'.join(line_list) + file_contents[end_of_marker_line:]
self.host.filesystem.write_text_file(expectations_file_path, file_contents)
@staticmethod
def _test_name_from_expectation_string(expectation_string):
return TestExpectationLine.tokenize_line(filename='', expectation_string=expectation_string, line_number=0).name
def get_expected_txt_files(self, tests_results):
"""Fetches new baseline files for tests that should be rebaselined.
Invokes webkit-patch rebaseline-from-try-jobs in order to download new
-expected.txt files for testharness.js tests that did not crash or time
out. Then, the platform-specific test is removed from the overall
failure test dictionary.
Args:
tests_results: A dict mapping test name to platform to test results.
Returns:
An updated tests_results dictionary without the platform-specific
testharness.js tests that required new baselines to be downloaded
from `webkit-patch rebaseline-from-try-jobs`.
"""
modified_tests = self.get_modified_existing_tests()
tests_to_rebaseline, tests_results = self.get_tests_to_rebaseline(modified_tests, tests_results)
_log.debug('Tests to rebaseline: %r', tests_to_rebaseline)
if tests_to_rebaseline:
webkit_patch = self.host.filesystem.join(
self.finder.chromium_base(), self.finder.webkit_base(), self.finder.path_to_script('webkit-patch'))
self.host.executive.run_command([
'python',
webkit_patch,
'rebaseline-cl',
'--verbose',
'--no-trigger-jobs',
] + tests_to_rebaseline)
return tests_results
def get_modified_existing_tests(self):
"""Returns a list of layout test names for layout tests that have been modified."""
diff_output = self.host.executive.run_command(
['git', 'diff', 'origin/master', '--name-only', '--diff-filter=AMR']) # Added, modified, and renamed files.
paths_from_chromium_root = diff_output.splitlines()
modified_tests = []
for path in paths_from_chromium_root:
absolute_path = self.host.filesystem.join(self.finder.chromium_base(), path)
if not self.host.filesystem.exists(absolute_path):
_log.warning('File does not exist: %s', absolute_path)
continue
test_path = self.finder.layout_test_name(path)
if test_path:
modified_tests.append(test_path)
return modified_tests
def get_tests_to_rebaseline(self, modified_tests, test_results):
"""Returns a list of tests to download new baselines for.
Creates a list of tests to rebaseline depending on the tests' platform-
specific results. In general, this will be non-ref tests that failed
due to a baseline mismatch (rather than crash or timeout).
示例4: test_chromium_base
# 需要导入模块: from webkitpy.common.webkit_finder import WebKitFinder [as 别名]
# 或者: from webkitpy.common.webkit_finder.WebKitFinder import chromium_base [as 别名]
def test_chromium_base(self):
finder = WebKitFinder(MockFileSystem())
self.assertEqual(finder.chromium_base(), '/mock-checkout')