206 trace_output = """
207[{"ph":"X","name":"void skottie::Animation::seek(SkScalar)","ts":452,"dur":2.57,"tid":1,"pid":0},{"ph":"X","name":"void SkCanvas::drawPaint(const SkPaint &)","ts":473,"dur":2.67e+03,"tid":1,"pid":0},{"ph":"X","name":"void skottie::Animation::seek(SkScalar)","ts":3.15e+03,"dur":2.25,"tid":1,"pid":0},{"ph":"X","name":"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const","ts":3.15e+03,"dur":216,"tid":1,"pid":0},{"ph":"X","name":"void SkCanvas::drawPath(const SkPath &, const SkPaint &)","ts":3.35e+03,"dur":15.1,"tid":1,"pid":0},{"ph":"X","name":"void skottie::Animation::seek(SkScalar)","ts":3.37e+03,"dur":1.17,"tid":1,"pid":0},{"ph":"X","name":"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const","ts":3.37e+03,"dur":140,"tid":1,"pid":0}]
208"""
209 dm_json_test_data = """
210{
211 "gitHash": "bac53f089dbc473862bc5a2e328ba7600e0ed9c4",
212 "swarming_bot_id": "skia-rpi-094",
213 "swarming_task_id": "438f11c0e19eab11",
214 "key": {
215 "arch": "arm",
216 "compiler": "Clang",
217 "cpu_or_gpu": "GPU",
218 "cpu_or_gpu_value": "Mali400MP2",
219 "extra_config": "Android",
220 "model": "AndroidOne",
221 "os": "Android"
222 },
223 "results": {
224 }
225}
226"""
227 parse_trace_json = {
228 'frame_avg_us': 179.71,
229 'frame_min_us': 141.17,
230 'frame_max_us': 218.25
231 }
232 android_buildername = ('Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-'
233 'Release-All-Android_SkottieTracing')
234 gpu_buildername = ('Perf-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-'
235 'Release-All-SkottieTracing')
236 cpu_buildername = ('Perf-Debian10-Clang-GCE-CPU-AVX2-x86_64-Release-All-'
237 'SkottieTracing')
238 yield (
239 api.test(android_buildername) +
240 api.properties(buildername=android_buildername,
241 repository='https://skia.googlesource.com/skia.git',
242 revision='abc123',
243 task_id='abc123',
244 trace_test_data=trace_output,
245 dm_json_test_data=dm_json_test_data,
246 path_config='kitchen',
247 swarm_out_dir='[SWARM_OUT_DIR]') +
248 api.step_data('parse skottie_asset_000 trace',
249 api.json.output(parse_trace_json)) +
250 api.step_data('parse skottie_asset_001 trace',
251 api.json.output(parse_trace_json)) +
252 api.step_data('parse skottie_asset_002 trace',
253 api.json.output(parse_trace_json))
254 )
255 yield (
256 api.test(gpu_buildername) +
257 api.properties(buildername=gpu_buildername,
258 repository='https://skia.googlesource.com/skia.git',
259 revision='abc123',
260 task_id='abc123',
261 trace_test_data=trace_output,
262 dm_json_test_data=dm_json_test_data,
263 path_config='kitchen',
264 swarm_out_dir='[SWARM_OUT_DIR]') +
265 api.step_data('parse skottie_asset_000 trace',
266 api.json.output(parse_trace_json)) +
267 api.step_data('parse skottie_asset_001 trace',
268 api.json.output(parse_trace_json)) +
269 api.step_data('parse skottie_asset_002 trace',
270 api.json.output(parse_trace_json))
271 )
272 yield (
273 api.test(cpu_buildername) +
274 api.properties(buildername=cpu_buildername,
275 repository='https://skia.googlesource.com/skia.git',
276 revision='abc123',
277 task_id='abc123',
278 trace_test_data=trace_output,
279 dm_json_test_data=dm_json_test_data,
280 path_config='kitchen',
281 swarm_out_dir='[SWARM_OUT_DIR]') +
282 api.step_data('parse skottie_asset_000 trace',
283 api.json.output(parse_trace_json)) +
284 api.step_data('parse skottie_asset_001 trace',
285 api.json.output(parse_trace_json)) +
286 api.step_data('parse skottie_asset_002 trace',
287 api.json.output(parse_trace_json))
288 )
289 yield (
290 api.test('skottietracing_parse_trace_error') +
291 api.properties(buildername=android_buildername,
292 repository='https://skia.googlesource.com/skia.git',
293 revision='abc123',
294 task_id='abc123',
295 trace_test_data=trace_output,
296 dm_json_test_data=dm_json_test_data,
297 path_config='kitchen',
298 swarm_out_dir='[SWARM_OUT_DIR]') +
299 api.step_data('parse skottie_asset_000 trace',
300 api.json.output(parse_trace_json), retcode=1)
301 )
302 yield (
303 api.test('skottietracing_trybot') +
304 api.properties(buildername=android_buildername,
305 repository='https://skia.googlesource.com/skia.git',
306 revision='abc123',
307 task_id='abc123',
308 trace_test_data=trace_output,
309 dm_json_test_data=dm_json_test_data,
310 path_config='kitchen',
311 swarm_out_dir='[SWARM_OUT_DIR]',
312 patch_ref='89/456789/12',
313 patch_repo='https://skia.googlesource.com/skia.git',
314 patch_storage='gerrit',
315 patch_set=7,
316 patch_issue=1234,
317 gerrit_project='skia',
318 gerrit_url='https://skia-review.googlesource.com/') +
319 api.step_data('parse skottie_asset_000 trace',
320 api.json.output(parse_trace_json)) +
321 api.step_data('parse skottie_asset_001 trace',
322 api.json.output(parse_trace_json)) +
323 api.step_data('parse skottie_asset_002 trace',
324 api.json.output(parse_trace_json))
325 )