Commit 0a50f563 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Add VR version of smoothness benchmark

Adds a version of KeyMobileSitesSmoothPageSet page set and
SmoothnessKeyMobileSites benchmark for use in the VR browser.

This re-uses all the same URLs/pages, but also adds a Vimeo page since
video is a large use case for VR.

Bug: 732830
Change-Id: I9146c1d2056527b8460b56a8b28f5da47ead1b23
Reviewed-on: https://chromium-review.googlesource.com/963042
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554835}
parent 7dea9b2c
This is a copy of the key_mobile_sites WPR archives from
//tools/perf/page_sets/data. We want to re-use the same archives for our
smoothness benchmark as the regular smoothness benchmark, but we also need to
add some new archives that are VR-specific/not useful for the non-VR benchmark.
So, copy the .sha1s and JSON file so we can download the pre-existing data while
being free to add new archives as we need.
a5ff4777d74fe2deb228b1737bc17f6acf7abe12
\ No newline at end of file
f351d9a611b437abc0f5e0e916d1c3a1b5ea47a8
\ No newline at end of file
1ab785f50be453e74743f96a0acab69c0b22565a
\ No newline at end of file
90ce380ec8bcc63456855ffba457922a3b17ae02
\ No newline at end of file
3e566c621ddeb82d993216018bb670aebdaaf397
\ No newline at end of file
7c93d9bc80acd8f021d08e1c95593d336553c517
\ No newline at end of file
4515cf268ce80b64f24b4198b8ef58a90455ffff
\ No newline at end of file
8c5ee424c356b3ccd3a19e23aeefb7acf736a1a8
\ No newline at end of file
0f1427110ff6dbe676a5dedc7b225b474f9ee6d7
\ No newline at end of file
dd5ca8a3e4ebbd173b69597f11fab1cd59a12f29
\ No newline at end of file
24be657655fedc34b9462632baaa678a759f363d
\ No newline at end of file
55b355eecc12fdaf9521181508f3c8abeff477f1
\ No newline at end of file
45d33e89afc119359b49ded38bf8f977fcffff8e
\ No newline at end of file
4168e2e0672f038f39450c0babbf4b4be6cbb1d7
\ No newline at end of file
6fbfdaa7f5ee08be5d381f8426b64338daa63e2c
\ No newline at end of file
9e603dce548fc0fdbb916a1cff04a0b7e7360782
\ No newline at end of file
c3443ef998637dc7c0517e0ddfd55875cc1538f8
\ No newline at end of file
{
"archives": {
"amazon": {
"DEFAULT": "key_mobile_sites_015.wprgo"
},
"androidpolice": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"baidu": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"bing": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"blogspot": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"boingboing": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"booking.com": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"capitolvolkswagen": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"cnn": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"cnn_article": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"cuteoverload": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"deviantart": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"digg": {
"DEFAULT": "key_mobile_sites_014.wprgo"
},
"ebay": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"espn": {
"DEFAULT": "key_mobile_sites_012.wprgo"
},
"facebook": {
"DEFAULT": "key_mobile_sites_003.wprgo"
},
"forecast.io": {
"DEFAULT": "key_mobile_sites_013.wprgo"
},
"gmail": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"google_calendar": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"google_news": {
"DEFAULT": "key_mobile_sites_006.wprgo"
},
"google_plus": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"google_web_search": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"gsp.ro": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"latimes": {
"DEFAULT": "key_mobile_sites_007.wprgo"
},
"linkedin": {
"DEFAULT": "key_mobile_sites_002.wprgo"
},
"mlb": {
"DEFAULT": "key_mobile_sites_002.wprgo"
},
"nytimes": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"pinterest": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"reddit": {
"DEFAULT": "key_mobile_sites_010.wprgo"
},
"sfgate": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"slashdot": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"techcrunch": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"theverge": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"theverge_article": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"twitter": {
"DEFAULT": "key_mobile_sites_011.wprgo"
},
"usatoday": {
"DEFAULT": "key_mobile_sites_007.wprgo"
},
"vimeo": {
"DEFAULT": "key_mobile_sites_016.wprgo"
},
"wikipedia": {
"DEFAULT": "key_mobile_sites_009.wprgo"
},
"wikipedia_delayed_scroll_start": {
"DEFAULT": "key_mobile_sites_009.wprgo"
},
"wordpress": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"worldjournal": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"wowwiki": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"wsj": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"yahoo_answers": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"yahoo_news": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"yahoo_sports": {
"DEFAULT": "key_mobile_sites_000.wprgo"
},
"youtube": {
"DEFAULT": "key_mobile_sites_000.wprgo"
}
},
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
"platform_specific": true
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ import logging ...@@ -6,6 +6,7 @@ import logging
from benchmarks import memory from benchmarks import memory
from core import perf_benchmark from core import perf_benchmark
from measurements import smoothness
from telemetry import benchmark from telemetry import benchmark
from telemetry import story from telemetry import story
from telemetry.timeline import chrome_trace_category_filter from telemetry.timeline import chrome_trace_category_filter
...@@ -174,3 +175,17 @@ class XrBrowsingWprStatic(_BaseBrowsingBenchmark): ...@@ -174,3 +175,17 @@ class XrBrowsingWprStatic(_BaseBrowsingBenchmark):
@classmethod @classmethod
def Name(cls): def Name(cls):
return 'xr.browsing.wpr.static' return 'xr.browsing.wpr.static'
@benchmark.Owner(emails=['tiborg@chromium.org', 'bsheedy@chromium.org'])
class XrBrowsingWprSmoothness(_BaseBrowsingBenchmark):
"""Benchmark for testing VR browser scrolling smoothness and throughput."""
test = smoothness.Smoothness
def CreateStorySet(self, options):
return vr_browsing_mode_pages.VrBrowsingModeWprSmoothnessPageSet()
@classmethod
def Name(cls):
return 'xr.browsing.wpr.smoothness'
...@@ -6,14 +6,16 @@ import re ...@@ -6,14 +6,16 @@ import re
from telemetry import page from telemetry import page
from telemetry import story from telemetry import story
from telemetry.page import shared_page_state
from devil.android.sdk import intent # pylint: disable=import-error from devil.android.sdk import intent # pylint: disable=import-error
from contrib.vr_benchmarks import shared_android_vr_page_state as vr_state from contrib.vr_benchmarks import shared_android_vr_page_state as vr_state
from contrib.vr_benchmarks.vr_sample_page import VrSamplePage from contrib.vr_benchmarks.vr_sample_page import VrSamplePage
from contrib.vr_benchmarks.vr_story_set import VrStorySet from contrib.vr_benchmarks.vr_story_set import VrStorySet
from page_sets import top_10_mobile from page_sets import top_10_mobile
from page_sets import key_mobile_sites_smooth as smooth_sites
def _VrBrowsingInteraction(current_page, action_runner): def _EnterVrViaNfc(current_page, action_runner):
def isNfcAppReady(android_app): def isNfcAppReady(android_app):
del android_app del android_app
# TODO(tiborg): Find a way to tell if the NFC app ran successfully. # TODO(tiborg): Find a way to tell if the NFC app ran successfully.
...@@ -32,6 +34,10 @@ def _VrBrowsingInteraction(current_page, action_runner): ...@@ -32,6 +34,10 @@ def _VrBrowsingInteraction(current_page, action_runner):
# Browsing Mode. Wait times are flaky. # Browsing Mode. Wait times are flaky.
action_runner.Wait(2) action_runner.Wait(2)
def _EnterVrViaNfcWithMemory(current_page, action_runner):
_EnterVrViaNfc(current_page, action_runner)
# MeasureMemory() waits for 10 seconds before measuring memory, which is # MeasureMemory() waits for 10 seconds before measuring memory, which is
# long enough for us to collect our other data, so no additional sleeps # long enough for us to collect our other data, so no additional sleeps
# necessary. # necessary.
...@@ -46,7 +52,7 @@ class Simple2dStillPage(VrSamplePage): ...@@ -46,7 +52,7 @@ class Simple2dStillPage(VrSamplePage):
sample_page=sample_page, page_set=page_set) sample_page=sample_page, page_set=page_set)
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
_VrBrowsingInteraction(self, action_runner) _EnterVrViaNfcWithMemory(self, action_runner)
class VrBrowsingModeWprPage(page.Page): class VrBrowsingModeWprPage(page.Page):
...@@ -70,7 +76,7 @@ class VrBrowsingModeWprPage(page.Page): ...@@ -70,7 +76,7 @@ class VrBrowsingModeWprPage(page.Page):
self._shared_page_state = None self._shared_page_state = None
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
_VrBrowsingInteraction(self, action_runner) _EnterVrViaNfcWithMemory(self, action_runner)
def Run(self, shared_state): def Run(self, shared_state):
self._shared_page_state = shared_state self._shared_page_state = shared_state
...@@ -105,3 +111,109 @@ class VrBrowsingModeWprPageSet(VrStorySet): ...@@ -105,3 +111,109 @@ class VrBrowsingModeWprPageSet(VrStorySet):
for url in top_10_mobile.URL_LIST: for url in top_10_mobile.URL_LIST:
name = re.sub(r'\W+', '_', url) name = re.sub(r'\W+', '_', url)
self.AddStory(VrBrowsingModeWprPage(self, url, name)) self.AddStory(VrBrowsingModeWprPage(self, url, name))
class VrBrowsingModeWprSmoothnessPage(VrBrowsingModeWprPage):
"""Hybrid of VrBrowsingModeWprPage and KeyMobileSitesSmoothPage."""
def __init__(self, page_set, url, name, extra_browser_args=None, **kwargs):
self._page_impl = smooth_sites.KeyMobileSitesSmoothPage(
url=url, page_set=page_set, name=name,
extra_browser_args=extra_browser_args, **kwargs)
super(VrBrowsingModeWprSmoothnessPage, self).__init__(
url=url,
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunPageInteractions(self, action_runner):
_EnterVrViaNfc(self, action_runner)
self._page_impl.RunPageInteractions(action_runner)
class VrBrowsingModeWprSmoothnessPageWrapper(VrBrowsingModeWprPage):
"""Wrapper class for running special pages in VR.
A number of pre-existing pages used for scroll testing require special
navigation and interaction steps, as opposed to just loading some URL and
scrolling. Since we need to inherit from a page that exposes the shared state
and/or platform during a story run, we can't just directly inherit from them.
This way, we're able to inherit from a VR page that exposes the shared state,
but re-use the navigation/interaction code from the non-VR pages while
avoiding things like multiple inheritance.
"""
def __init__(self, page_set, name, page_class, extra_browser_args=None):
self._page_impl = page_class(
page_set=page_set, name=name, extra_browser_args=None)
super(VrBrowsingModeWprSmoothnessPageWrapper, self).__init__(
url=self._page_impl.url,
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
self._page_impl.RunNavigateSteps(action_runner)
def RunPageInteractions(self, action_runner):
_EnterVrViaNfc(self, action_runner)
self._page_impl.RunPageInteractions(action_runner)
class VimeoPage(smooth_sites.KeyMobileSitesSmoothPage):
"""Page created in the same manner as other smoothness pages, but only for VR.
Why: Video is a large use case for the VR browser, but Vimeo isn't popular
enough to warrant putting in the normal key_mobile_sites_smooth page set.
"""
def __init__(self, page_set, name='', extra_browser_args=None,
shared_page_state_class=shared_page_state.SharedMobilePageState):
super(VimeoPage, self).__init__(
url='https://vimeo.com/search?q=Vr',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args,
shared_page_state_class=shared_page_state_class)
# Make sure we have enough results loaded to fully scroll.
def RunNavigateSteps(self, action_runner):
super(VimeoPage, self).RunNavigateSteps(action_runner)
action_runner.ScrollPage()
action_runner.ScrollPage(direction='up')
class VrBrowsingModeWprSmoothnessPageSet(VrStorySet):
"""Copy of KeyMobileSitesSmoothpageSet, but in the VR browser."""
def __init__(self):
super(VrBrowsingModeWprSmoothnessPageSet, self).__init__(
archive_data_file='data/key_mobile_sites/key_mobile_sites_smooth.json',
cloud_storage_bucket=story.PARTNER_BUCKET)
# Add pages that require special navigation or interaction code.
page_classes = [
(smooth_sites.CapitolVolkswagenPage, 'capitolvolkswagen'),
(smooth_sites.TheVergeArticlePage, 'theverge_article'),
(smooth_sites.CnnArticlePage, 'cnn_article'),
(smooth_sites.FacebookPage, 'facebook'),
(smooth_sites.YoutubeMobilePage, 'youtube'),
(smooth_sites.GoogleNewsMobilePage, 'google_news'),
(smooth_sites.LinkedInPage, 'linkedin'),
(smooth_sites.WowwikiPage, 'wowwiki'),
(smooth_sites.AmazonNicolasCagePage, 'amazon'),
(VimeoPage, 'vimeo'),
]
for page_class, name in page_classes:
self.AddStory(VrBrowsingModeWprSmoothnessPageWrapper(
page_set=self, page_class=page_class, name=name))
# Add pages with custom tags.
for url, name in smooth_sites.FASTPATH_URLS:
self.AddStory(VrBrowsingModeWprSmoothnessPage(
url=url, page_set=self, name=name, tags=['fastpath']))
# Add normal pages.
for url, name in smooth_sites.URLS_LIST:
self.AddStory(VrBrowsingModeWprSmoothnessPage(
url=url, page_set=self, name=name))
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