本文整理汇总了Python中src.build.build_options.OPTIONS.is_official_chrome方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_official_chrome方法的具体用法?Python OPTIONS.is_official_chrome怎么用?Python OPTIONS.is_official_chrome使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.build.build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.is_official_chrome方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_chrome_exe_path_on_local_host
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_official_chrome [as 别名]
def get_chrome_exe_path_on_local_host():
if OPTIONS.is_official_chrome():
assert platform.system() == "Linux", "Only Linux is supported this time"
if OPTIONS.chrometype() == "dev":
chrome_dir = "chrome-unstable"
elif OPTIONS.chrometype() == "beta":
chrome_dir = "chrome-beta"
else:
chrome_dir = "chrome"
return os.path.join(get_chrome_prebuilt_path(), "opt", "google", chrome_dir, "chrome")
else:
return os.path.join(get_chrome_prebuilt_path(), "chrome")
示例2: _is_no_sandbox_needed
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_official_chrome [as 别名]
def _is_no_sandbox_needed(parsed_args):
if parsed_args.disable_nacl_sandbox:
return True
# Official Chrome needs setuid + root ownership to run. --no-sandbox
# bypasses that.
if OPTIONS.is_official_chrome():
return True
# In some cases, --no-sandbox is needed to work gdb properly.
if gdb_util.is_no_sandbox_needed(parsed_args.gdb):
return True
# Set --no-sandbox on Mac for now because ARC apps crash on Mac Chromium
# without the flag.
# TODO(crbug.com/332785): Investigate the cause of crash and remove the flag
# if possible.
if platform_util.is_running_on_mac():
return True
return False