Lines Matching refs:api

31 def test_steps(api):
33 do_upload = api.properties.get('do_upload') == 'true'
34 images = api.properties.get('images') == 'true'
35 lotties = api.properties.get('lotties') == 'true'
36 resources = api.properties.get('resources') == 'true'
37 skps = api.properties.get('skps') == 'true'
38 svgs = api.properties.get('svgs') == 'true'
40 api.flavor.install(
50 host_dm_dir = str(api.flavor.host_dirs.dm_dir)
51 api.flavor.create_clean_host_dir(api.path['start_dir'].join('test'))
52 device_dm_dir = str(api.flavor.device_dirs.dm_dir)
54 api.flavor.create_clean_device_dir(device_dm_dir)
59 host_hashes_file = api.vars.tmp_dir.join(hash_filename)
60 hashes_file = api.flavor.device_path_join(
61 api.flavor.device_dirs.tmp_dir, hash_filename)
62 api.run(
63 api.python.inline,
96 args=[api.properties['gold_hashes_url'], host_hashes_file],
101 if api.path.exists(host_hashes_file):
102 api.flavor.copy_file_to_device(host_hashes_file, hashes_file)
106 args = json.loads(api.properties['dm_flags'])
107 props = json.loads(api.properties['dm_properties'])
114 v = api.vars.swarming_bot_id
116 v = api.vars.swarming_task_id
122 args.extend(['--resourcePath', api.flavor.device_dirs.resource_dir])
124 args.extend(['--skps', api.flavor.device_dirs.skp_dir])
127 '--images', api.flavor.device_path_join(
128 api.flavor.device_dirs.images_dir, 'dm'),
129 '--colorImages', api.flavor.device_path_join(
130 api.flavor.device_dirs.images_dir, 'colorspace'),
135 args.extend(['--svgs', api.flavor.device_path_join(
136 api.flavor.device_dirs.svg_dir, "svg")])
140 api.flavor.device_path_join(
141 api.flavor.device_dirs.resource_dir, 'skottie'),
142 api.flavor.device_dirs.lotties_dir,
148 args.extend(['--writePath', api.flavor.device_dirs.dm_dir])
151 api.run(api.flavor.step, 'dm', cmd=args, abort_on_failure=False)
155 api.flavor.copy_directory_contents_to_host(
156 api.flavor.device_dirs.dm_dir, api.flavor.host_dirs.dm_dir)
158 if 'Win' not in api.vars.builder_cfg.get('os', ''):
159 api.gold_upload.upload()
162 def RunSteps(api):
163 api.vars.setup()
164 api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir)
165 api.flavor.setup('dm')
168 test_steps(api)
170 api.flavor.cleanup_steps()
171 api.run.check_failure()
182 def GenTests(api):
211 api.test(builder) +
212 api.properties(**props) +
213 api.path.exists(
214 api.path['start_dir'].join('skia'),
215 api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
217 api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
219 api.path['start_dir'].join('skia', 'infra', 'bots', 'assets',
221 api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
223 api.step_data('get swarming bot id',
224 stdout=api.raw_io.output('skia-bot-123')) +
225 api.step_data('get swarming task id',
226 stdout=api.raw_io.output('123456'))
229 test += api.platform('win', 64)