Commit 3c903294 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Make VR sample page names match dashboard

Replaces characters that are unsupported by the performance dashboard
with underscores in benchmarks that use WebVR and WebXR sample pages.
This is so that the name reported on the dashboard can actually be
used as a story filter when bisecting.

Bug: 881017
Change-Id: Ifae260815a1382ce5dcab9e393ad8b0344ab0f86
Reviewed-on: https://chromium-review.googlesource.com/c/1252848Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596025}
parent 930dfaff
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import os import os
import re
from telemetry import page from telemetry import page
from contrib.vr_benchmarks import (shared_android_vr_page_state as from contrib.vr_benchmarks import (shared_android_vr_page_state as
vr_state) vr_state)
...@@ -26,6 +27,13 @@ class _VrXrSamplePage(page.Page): ...@@ -26,6 +27,13 @@ class _VrXrSamplePage(page.Page):
if url_parameters is not None: if url_parameters is not None:
url += '?' + '&'.join(url_parameters) url += '?' + '&'.join(url_parameters)
name = url.replace('.html', '') name = url.replace('.html', '')
# Replace characters that are unsupported by the perf dashboard here so that
# the name reported on the dashboard can be used as a story filter.
# We don't use a the \W+ regex like other benchmarks because we need to
# keep certain non-alphanumeric characters around for backwards naming
# compatibility. This regex should replace anything except alphanumeric,
# question mark, dash, and period characters with underscores.
name = re.sub(r'[^a-zA-Z\d\?\-\.]+', '_', name)
url = 'file://' + os.path.join(sample_directory, url) url = 'file://' + os.path.join(sample_directory, url)
super(_VrXrSamplePage, self).__init__( super(_VrXrSamplePage, self).__init__(
url=url, url=url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment