diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-02-13 16:03:23 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-05-26 11:26:35 +0000 |
commit | 813d9ae984a99e739b99cf694a9d5b24d0a6b7a7 (patch) | |
tree | 60c14d40d77a3c702c8a72887662d97c0b8f3e99 /chromium/build/fuchsia/emu_target.py | |
parent | eb596ba9fe579987eb93f6b4021ca156885b48c2 (diff) |
BASELINE: Update Chromium to 110.0.5481.111
Change-Id: I2b5f5ed66fee2a6f8da61c9b17fd1b25bb5b3a4e
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/464348
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/build/fuchsia/emu_target.py')
-rw-r--r-- | chromium/build/fuchsia/emu_target.py | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/chromium/build/fuchsia/emu_target.py b/chromium/build/fuchsia/emu_target.py index e1c2ace0e35..d430cdf8aaa 100644 --- a/chromium/build/fuchsia/emu_target.py +++ b/chromium/build/fuchsia/emu_target.py @@ -17,11 +17,15 @@ import ffx_session import pkg_repo import target +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), + 'test'))) +from compatible_utils import find_image_in_sdk, running_unattended + class EmuTarget(target.Target): LOCAL_ADDRESS = 'localhost' - def __init__(self, out_dir, target_cpu, logs_dir): + def __init__(self, out_dir, target_cpu, logs_dir, image): """out_dir: The directory which will contain the files that are generated to support the emulator deployment. target_cpu: The emulated target CPU architecture. @@ -33,6 +37,27 @@ class EmuTarget(target.Target): self._target_context = None self._ffx_target = None + self._pb_path = self._GetPbPath(image) + metadata = self._GetEmuMetadata() + self._disk_image = metadata['disk_images'][0] + self._kernel = metadata['kernel'] + self._ramdisk = metadata['initial_ramdisk'] + + def _GetPbPath(self, image): + if not image: + image = 'terminal.qemu-%s' % self._target_cpu + image_path = find_image_in_sdk(image, + product_bundle=True, + sdk_root=os.path.dirname(common.IMAGES_ROOT)) + if not image_path: + raise FileNotFoundError(f'Product bundle {image} is not downloaded. Add ' + 'the image and run "gclient sync" again.') + return image_path + + def _GetEmuMetadata(self): + with open(os.path.join(self._pb_path, 'product_bundle.json')) as f: + return json.load(f)['data']['manifests']['emu'] + def __enter__(self): return self @@ -44,7 +69,7 @@ class EmuTarget(target.Target): return os.environ.copy() def Start(self): - if common.IsRunningUnattended() and not self._HasNetworking(): + if running_unattended() and not self._HasNetworking(): # Bots may accumulate stale manually-added targets with the same address # as the one to be added here. Preemtively remove any unknown targets at # this address before starting the emulator and adding it as a target. |