Commit 54fc973c authored by vollick@chromium.org's avatar vollick@chromium.org

Add robohornet as an animation test

Robohornet's main page is a good animation stress test (even without running the robohornet test).

Rather than hacking in a scrolling interaction, I decided to make a wait interaction since that's more appropriate for animation related smoothness tests.
It no longer made sense for the section in the page sets to be labeled "scrolling" any longer -- "smoothness" is more appropriate. I've made this change as well.

BUG=None


Review URL: https://chromiumcodereview.appspot.com/11734036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175188 0039d316-1c4b-4281-b951-d872f2087c98
parent 27395b94
This diff is collapsed.
{ {
"description": "A collection of animation performance tests", "description": "A collection of animation performance tests",
"pages": [ "pages": [
{"url": "file:///animations/keyframed_animations.html"}, {
{"url": "file:///animations/transform_transitions.html"} "url": "file:///animations/keyframed_animations.html",
"why": "Tests various keyframed animations.",
"smoothness": {
"action": "wait_interaction",
"duration": 5
}
},
{
"url": "file:///animations/transform_transitions.html",
"why": "Tests various transitions.",
"smoothness": {
"action": "wait_interaction",
"duration": 5
}
},
{
"url": "http://ie.microsoft.com/testdrive/performance/robohornetpro/",
"why": "Login page is slow because of ineffecient transform operations",
"smoothness": {
"action": "wait_interaction",
"duration": 5
}
}
] ]
} }
This diff is collapsed.
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{ {
"url": "https://www.google.com/#hl=en&q=barack+obama", "url": "https://www.google.com/#hl=en&q=barack+obama",
"why": "top google property; a google tab is often open", "why": "top google property; a google tab is often open",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
}, },
"wait_for_element_with_text": "Next", "wait_for_element_with_text": "Next",
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"why": "productivity, top google properties", "why": "productivity, top google properties",
"credentials": "google", "credentials": "google",
"wait_for_javascript_expression": "window.gmonkey !== undefined && document.getElementById('gb') !== null", "wait_for_javascript_expression": "window.gmonkey !== undefined && document.getElementById('gb') !== null",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scrollable_element_function": "function(callback) { gmonkey.load('2.0', function(api) { callback(api.getScrollableElement()); }); }" "scrollable_element_function": "function(callback) { gmonkey.load('2.0', function(api) { callback(api.getScrollableElement()); }); }"
}, },
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
"why": "productivity, top google properties", "why": "productivity, top google properties",
"credentials": "google", "credentials": "google",
"wait_for_element_with_selector": "div[class~=\"navForward\"]", "wait_for_element_with_selector": "div[class~=\"navForward\"]",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scrollable_element_function": "function(callback) { callback(document.getElementById('scrolltimedeventswk')); }" "scrollable_element_function": "function(callback) { callback(document.getElementById('scrolltimedeventswk')); }"
}, },
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
"why": "productivity, top google properties", "why": "productivity, top google properties",
"credentials": "google", "credentials": "google",
"wait_for_javascript_expression": "document.getElementsByClassName('doclistview-list').length", "wait_for_javascript_expression": "document.getElementsByClassName('doclistview-list').length",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scrollable_element_function": "function(callback) { callback(document.getElementsByClassName('doclistview-list')[0]); }" "scrollable_element_function": "function(callback) { callback(document.getElementsByClassName('doclistview-list')[0]); }"
} }
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
"why": "productivity, top google properties; Sample doc in the link", "why": "productivity, top google properties; Sample doc in the link",
"credentials": "google", "credentials": "google",
"wait_for_javascript_expression": "document.getElementsByClassName('kix-appview-editor').length", "wait_for_javascript_expression": "document.getElementsByClassName('kix-appview-editor').length",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scrollable_element_function": "function(callback) { callback(document.getElementsByClassName('kix-appview-editor')[0]); }" "scrollable_element_function": "function(callback) { callback(document.getElementsByClassName('kix-appview-editor')[0]); }"
} }
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
"why": "social; top google property; Public profile; infinite scrolls", "why": "social; top google property; Public profile; infinite scrolls",
"credentials": "google", "credentials": "google",
"wait_for_element_with_text": "Home", "wait_for_element_with_text": "Home",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scroll_is_infinite": true "scroll_is_infinite": true
}, },
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
"url": "http://www.youtube.com", "url": "http://www.youtube.com",
"why": "#3 (Alexa global)", "why": "#3 (Alexa global)",
"credentials": "google", "credentials": "google",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
"url": "http://googlewebmastercentral.blogspot.com/", "url": "http://googlewebmastercentral.blogspot.com/",
"why": "#11 (Alexa global), google property; some blogger layouts have infinite scroll but more interesting", "why": "#11 (Alexa global), google property; some blogger layouts have infinite scroll but more interesting",
"wait_for_element_with_text": "accessibility", "wait_for_element_with_text": "accessibility",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
}, },
"stress_memory": { "stress_memory": {
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
"url": "http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/", "url": "http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/",
"why": "#18 (Alexa global), Picked an interesting post", "why": "#18 (Alexa global), Picked an interesting post",
"wait_for_element_with_selector": "a[href=\"http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sight/\"]", "wait_for_element_with_selector": "a[href=\"http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sight/\"]",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
}, },
"stress_memory": { "stress_memory": {
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
"why": "top social,Public profile", "why": "top social,Public profile",
"credentials": "facebook", "credentials": "facebook",
"wait_for_element_with_text": "About", "wait_for_element_with_text": "About",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scroll_is_infinite": true "scroll_is_infinite": true
}, },
...@@ -389,7 +389,7 @@ ...@@ -389,7 +389,7 @@
"name": "LinkedIn", "name": "LinkedIn",
"url": "http://www.linkedin.com/in/linustorvalds", "url": "http://www.linkedin.com/in/linustorvalds",
"why": "#12 (Alexa global),Public profile", "why": "#12 (Alexa global),Public profile",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
...@@ -397,7 +397,7 @@ ...@@ -397,7 +397,7 @@
"name": "Wikipedia (1 tab)", "name": "Wikipedia (1 tab)",
"url": "http://en.wikipedia.org/wiki/Wikipedia", "url": "http://en.wikipedia.org/wiki/Wikipedia",
"why": "#6 (Alexa) most visited worldwide,Picked an interesting page", "why": "#6 (Alexa) most visited worldwide,Picked an interesting page",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
"name": "Twitter", "name": "Twitter",
"url": "http://twitter.com/katyperry", "url": "http://twitter.com/katyperry",
"why": "#8 (Alexa global),Picked an interesting page", "why": "#8 (Alexa global),Picked an interesting page",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scroll_is_infinite": true "scroll_is_infinite": true
} }
...@@ -414,7 +414,7 @@ ...@@ -414,7 +414,7 @@
"name": "Pinterest", "name": "Pinterest",
"url": "http://pinterest.com", "url": "http://pinterest.com",
"why": "#37 (Alexa global)", "why": "#37 (Alexa global)",
"scrolling": { "smoothness": {
"action": "scrolling_interaction", "action": "scrolling_interaction",
"scroll_is_infinite": true "scroll_is_infinite": true
} }
...@@ -423,21 +423,21 @@ ...@@ -423,21 +423,21 @@
"name": "ESPN", "name": "ESPN",
"url": "http://espn.go.com", "url": "http://espn.go.com",
"why": "#1 sports", "why": "#1 sports",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://news.yahoo.com", "url": "http://news.yahoo.com",
"why": "#1 news worldwide (Alexa global)", "why": "#1 news worldwide (Alexa global)",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://www.cnn.com", "url": "http://www.cnn.com",
"why": "#2 news worldwide", "why": "#2 news worldwide",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
...@@ -445,56 +445,56 @@ ...@@ -445,56 +445,56 @@
"name": "Weather.com", "name": "Weather.com",
"url": "http://www.weather.com/weather/right-now/Mountain+View+CA+94043", "url": "http://www.weather.com/weather/right-now/Mountain+View+CA+94043",
"why": "#7 (Alexa news); #27 total time spent,Picked interesting page", "why": "#7 (Alexa news); #27 total time spent,Picked interesting page",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://www.amazon.com", "url": "http://www.amazon.com",
"why": "#1 world commerce website by visits; #3 commerce in the US by time spent", "why": "#1 world commerce website by visits; #3 commerce in the US by time spent",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://www.ebay.com", "url": "http://www.ebay.com",
"why": "#1 commerce website by time spent by users in US", "why": "#1 commerce website by time spent by users in US",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://games.yahoo.com", "url": "http://games.yahoo.com",
"why": "#1 games according to Alexa (with actual games in it)", "why": "#1 games according to Alexa (with actual games in it)",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://booking.com", "url": "http://booking.com",
"why": "#1 Alexa recreation", "why": "#1 Alexa recreation",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://answers.yahoo.com", "url": "http://answers.yahoo.com",
"why": "#1 Alexa reference", "why": "#1 Alexa reference",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://sports.yahoo.com/", "url": "http://sports.yahoo.com/",
"why": "#1 Alexa sports", "why": "#1 Alexa sports",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "http://techcrunch.com", "url": "http://techcrunch.com",
"why": "top tech blog", "why": "top tech blog",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
} }
......
...@@ -3,55 +3,55 @@ ...@@ -3,55 +3,55 @@
"pages": [ "pages": [
{ {
"url": "file:///tough_scrolling_cases/background_fixed.html", "url": "file:///tough_scrolling_cases/background_fixed.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/cust_scrollbar.html", "url": "file:///tough_scrolling_cases/cust_scrollbar.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/div_scrolls.html", "url": "file:///tough_scrolling_cases/div_scrolls.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/fixed_nonstacking.html", "url": "file:///tough_scrolling_cases/fixed_nonstacking.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/fixed_stacking.html", "url": "file:///tough_scrolling_cases/fixed_stacking.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/iframe_scrolls.html", "url": "file:///tough_scrolling_cases/iframe_scrolls.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/simple.html", "url": "file:///tough_scrolling_cases/simple.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/wheel_body_prevdefault.html", "url": "file:///tough_scrolling_cases/wheel_body_prevdefault.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_scrolling_cases/wheel_div_prevdefault.html", "url": "file:///tough_scrolling_cases/wheel_div_prevdefault.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
} }
......
...@@ -3,25 +3,25 @@ ...@@ -3,25 +3,25 @@
"pages": [ "pages": [
{ {
"url": "file:///tough_texture_upload_cases/background_color_animation.html", "url": "file:///tough_texture_upload_cases/background_color_animation.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_texture_upload_cases/background_color_animation_and_transform_animation.html", "url": "file:///tough_texture_upload_cases/background_color_animation_and_transform_animation.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_texture_upload_cases/background_color_animation_with_gradient.html", "url": "file:///tough_texture_upload_cases/background_color_animation_with_gradient.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
}, },
{ {
"url": "file:///tough_texture_upload_cases/background_color_animation_with_gradient_and_transform_animation.html", "url": "file:///tough_texture_upload_cases/background_color_animation_with_gradient_and_transform_animation.html",
"scrolling": { "smoothness": {
"action": "scrolling_interaction" "action": "scrolling_interaction"
} }
} }
......
...@@ -144,7 +144,7 @@ def CalcImageDecodingResults(rendering_stats_deltas, results): ...@@ -144,7 +144,7 @@ def CalcImageDecodingResults(rendering_stats_deltas, results):
class SmoothnessBenchmark(multi_page_benchmark.MultiPageBenchmark): class SmoothnessBenchmark(multi_page_benchmark.MultiPageBenchmark):
def __init__(self): def __init__(self):
super(SmoothnessBenchmark, self).__init__('scrolling') super(SmoothnessBenchmark, self).__init__('smoothness')
self.force_enable_threaded_compositing = False self.force_enable_threaded_compositing = False
self.use_gpu_benchmarking_extension = True self.use_gpu_benchmarking_extension = True
...@@ -160,7 +160,7 @@ class SmoothnessBenchmark(multi_page_benchmark.MultiPageBenchmark): ...@@ -160,7 +160,7 @@ class SmoothnessBenchmark(multi_page_benchmark.MultiPageBenchmark):
options.extra_browser_args.append('--enable-threaded-compositing') options.extra_browser_args.append('--enable-threaded-compositing')
def CanRunForPage(self, page): def CanRunForPage(self, page):
return hasattr(page, 'scrolling') return hasattr(page, 'smoothness')
def MeasurePage(self, page, tab, results): def MeasurePage(self, page, tab, results):
rendering_stats_deltas = tab.runtime.Evaluate( rendering_stats_deltas = tab.runtime.Evaluate(
......
# Copyright (c) 2012 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.
from telemetry import page_interaction
from telemetry import util
class WaitInteraction(page_interaction.PageInteraction):
def __init__(self, attributes=None):
super(WaitInteraction, self).__init__(attributes)
def PerformInteraction(self, page, tab):
duration = 10
if hasattr(self, 'duration'):
duration = self.duration
wait_js = """
window.__renderingStatsDeltas = null;
var getTimeMs = (function() {
if (window.performance)
return (performance.now ||
performance.mozNow ||
performance.msNow ||
performance.oNow ||
performance.webkitNow).bind(window.performance);
else
return function() { return new Date().getTime(); };
})();
var getRenderingStats = function() {
var renderingStats = {};
if (chrome &&
chrome.gpuBenchmarking &&
chrome.gpuBenchmarking.renderingStats)
renderingStats = chrome.gpuBenchmarking.renderingStats();
renderingStats.totalTimeInSeconds = getTimeMs() / 1000;
return renderingStats;
}
var initialStats = getRenderingStats();
var waitFinishedCallback = function(init) {
return function() {
var final = getRenderingStats();
for (var key in final)
final[key] -= init[key];
window.__renderingStatsDeltas = final;
};
}
window.setTimeout(waitFinishedCallback(initialStats), %d);
""" % (duration * 1000)
tab.runtime.Evaluate(wait_js)
# Poll for scroll benchmark completion.
util.WaitFor(lambda: tab.runtime.Evaluate(
'window.__renderingStatsDeltas'), 60)
# Copyright (c) 2012 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
from telemetry import wait_interaction
from telemetry import tab_test_case
class WaitInteractionTest(tab_test_case.TabTestCase):
def testWaitInteraction(self):
unittest_data_dir = os.path.join(os.path.dirname(__file__),
'..', 'unittest_data')
self._browser.SetHTTPServerDirectory(unittest_data_dir)
self._tab.page.Navigate(
self._browser.http_server.UrlOf('blank.html'))
self._tab.WaitForDocumentReadyStateToBeComplete()
self.assertEquals(self._tab.runtime.Evaluate('document.location.pathname;'),
'/blank.html')
i = wait_interaction.WaitInteraction({ 'duration' : 1 })
i.PerformInteraction(self._tab.page, self._tab)
rendering_stats_deltas = self._tab.runtime.Evaluate(
'window.__renderingStatsDeltas')
# TODO(vollick): This should really be checking numFramesSentToScreen. The
# reason that doesn't work is that chrome.gpuBenchmarking.renderingStats is
# not available during unit tests. The scrolling interaction unit test
# cheats to get this number. scroll.js, when it detects that there's no
# chrome.gpuBenchmarking.renderingStats, uses RafRenderingStats to generate
# its results. This is a completely different codepath than is used when the
# interactions are actually run, so I don't believe those numbers should be
# trusted. During unit tests, the only valid rendering stat, currently, is
# total time in seconds.
self.assertTrue(rendering_stats_deltas['totalTimeInSeconds'] > 0)
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