Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 mskp_dir = self.chromeos_homedir + 'mskp',
31 tmp_dir = self.chromeos_homedir,
32 texttraces_dir = '')
33
34 def install(self):
35 super(ChromebookFlavor, self).install()
36
37 # Ensure the home dir is marked executable
38 self.ssh('remount %s as exec' % self.chromeos_homedir,
39 'sudo', 'mount', '-i', '-o', 'remount,exec', '/home/chronos')
40
41 def _copy_dir(self, src, dest):
42 script = self.module.resource('scp.py')
43 self.m.step(str('scp -r %s %s' % (src, dest)),
44 cmd=['python3', script, src, dest],
45 infra_step=True)
46
47 def copy_directory_contents_to_device(self, host_path, device_path):
48 self._copy_dir(host_path, self.scp_device_path(device_path))
49
50 def copy_directory_contents_to_host(self, device_path, host_path):
51 self._copy_dir(self.scp_device_path(device_path), host_path)
copy_directory_contents_to_device(self, host_path, device_path)
Definition chromebook.py:47
copy_directory_contents_to_host(self, device_path, host_path)
Definition chromebook.py:50
scp_device_path(self, device_path)
Definition ssh.py:69
ssh(self, title, *cmd, **kwargs)
Definition ssh.py:33
step(self, name, cmd, **kwargs)
Definition ssh.py:83