Flutter Engine
The Flutter Engine
chromebook.py
Go to the documentation of this file.
1# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5
6from recipe_engine import recipe_api
7
8from . import default
9from . import ssh
10
11
12"""Chromebook flavor, used for running code on Chromebooks."""
13
14
16
17 def __init__(self, m, app_name):
18 super(ChromebookFlavor, self).__init__(m, app_name)
19 self.chromeos_homedir = '/home/chronos/user/'
20 self.device_dirsdevice_dirs = default.DeviceDirs(
21 bin_dir = self.chromeos_homedir + 'bin',
22 dm_dir = self.chromeos_homedir + 'dm_out',
23 perf_data_dir = self.chromeos_homedir + 'perf',
24 resource_dir = self.chromeos_homedir + 'resources',
25 fonts_dir = 'NOT_SUPPORTED',
26 images_dir = self.chromeos_homedir + 'images',
27 lotties_dir = self.chromeos_homedir + 'lotties',
28 skp_dir = self.chromeos_homedir + 'skps',
29 svg_dir = self.chromeos_homedir + 'svgs',
30 tmp_dir = self.chromeos_homedir,
31 texttraces_dir = '')
32
33 def install(self):
34 super(ChromebookFlavor, self).install()
35
36 # Ensure the home dir is marked executable
37 self.ssh('remount %s as exec' % self.chromeos_homedir,
38 'sudo', 'mount', '-i', '-o', 'remount,exec', '/home/chronos')
39
40 def _copy_dir(self, src, dest):
41 script = self.module.resource('scp.py')
42 self.m.step(str('scp -r %s %s' % (src, dest)),
43 cmd=['python3', script, src, dest],
44 infra_step=True)
45
46 def copy_directory_contents_to_device(self, host_path, device_path):
47 self._copy_dir(host_path, self.scp_device_path(device_path))
48
49 def copy_directory_contents_to_host(self, device_path, host_path):
50 self._copy_dir(self.scp_device_path(device_path), host_path)
static SkString resource(SkPDFResourceType type, int index)
def _copy_dir(self, src, dest)
Definition: chromebook.py:40
def copy_directory_contents_to_host(self, device_path, host_path)
Definition: chromebook.py:49
def copy_directory_contents_to_device(self, host_path, device_path)
Definition: chromebook.py:46
def __init__(self, m, app_name)
Definition: chromebook.py:17
def ssh(self, title, *cmd, **kwargs)
Definition: ssh.py:33
def scp_device_path(self, device_path)
Definition: ssh.py:69
def step(self, name, cmd, **kwargs)
Definition: ssh.py:83