Commit 5c70e923 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Add VR Telemetry benchmark runner

Adds a benchmark runner for VR Telemetry tests that installs and configures
the necessary APKs before running the benchmark. VR benchmarks, pages,
actions, etc. will be added in follow-up CLs.

Bug: 738074, 726906
Change-Id: I88feccafbee51e83114ca0182e394d25a7c7f936
Reviewed-on: https://chromium-review.googlesource.com/563761
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#485421}
parent 171b4c6c
...@@ -691,7 +691,10 @@ group("gn_all") { ...@@ -691,7 +691,10 @@ group("gn_all") {
} }
if (enable_vr) { if (enable_vr) {
deps += [ "//chrome/browser/android/vr_shell:vr_common_unittests" ] deps += [
"//chrome/browser/android/vr_shell:vr_common_unittests",
"//tools/perf/contrib/vr_benchmarks:vr_perf_tests",
]
} }
} }
......
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
group("vr_perf_tests") {
testonly = true
data = [
"./__init__.py",
"./run_benchmark",
"./vr_config.py",
"benchmarks/",
"//chrome/android/shared_preference_files/test/",
"//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk",
]
data_deps = [
"//chrome/android:vr_nfc_simulator_apk",
]
deps = [
"//tools/perf:perf",
]
}
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import vr_config
sys.path.insert(1, vr_config.TELEMETRY_DIR)
sys.path.append(vr_config.PYLIB_DIR)
from pylib.constants import host_paths
if host_paths.DEVIL_PATH not in sys.path:
sys.path.append(host_paths.DEVIL_PATH)
from devil.android import device_utils
from pylib.utils import shared_preference_utils
from telemetry import benchmark_runner
def main():
attached_devices = device_utils.DeviceUtils.HealthyDevices()
if len(attached_devices) == 0:
raise ValueError('No healthy devices attached')
if len(attached_devices) > 1:
raise NotImplementedError('Only one device currently supported, multiple '
'found')
dev = attached_devices[0]
# Reinstall VrCore
# TODO(bsheedy): Change this to work if VrCore is still installed as a system
# app
dev.Install(os.path.join(host_paths.DIR_SOURCE_ROOT, 'third_party',
'gvr-android-sdk', 'test-apks', 'vr_services',
'vr_services_current.apk'))
# Install the NFC simulator APK
# TODO(bsheedy): Find a better way to get path to generated APK
dev.Install(os.path.join(host_paths.DIR_SOURCE_ROOT, 'out', 'Release',
'apks', 'VrNfcSimulator.apk'))
# Setup VrCore
# TODO(bsheedy): Support different files to allow tests to be run on both
# Daydream ready and non-Daydream-ready devices
preferences = shared_preference_utils.ExtractSettingsFromJson(os.path.join(
host_paths.DIR_SOURCE_ROOT, 'chrome', 'android',
'shared_preference_files', 'test', 'vr_ddview_skipdon_setupcomplete.json'
))
shared_preference_utils.ApplySharedPreferenceSettings(dev, preferences)
# Start the benchmarks
return benchmark_runner.main(vr_config.Config(['benchmarks']))
if __name__ == '__main__':
sys.exit(main())
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
# Add //tools/perf/ to system path
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from chrome_telemetry_build import chromium_config
from core import path_util
TELEMETRY_DIR = path_util.GetTelemetryDir()
PYLIB_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '..', '..', '..',
'build', 'android'))
_top_level_dir = os.path.dirname(os.path.realpath(__file__))
def Config(benchmark_subdirs):
return chromium_config.ChromiumConfig(
top_level_dir=_top_level_dir,
benchmark_dirs=[os.path.join(_top_level_dir, subdir)
for subdir in benchmark_subdirs])
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