Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: tools/perf/page_sets/todomvc.py

Issue 1782033002: [telemetry] Add page load interaction to V8.todomvc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/benchmarks/v8.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/todomvc.py
diff --git a/tools/perf/page_sets/todomvc.py b/tools/perf/page_sets/todomvc.py
index 5536c83f3fbbcd5742641fc88215c03413a90fd1..a7eaf09258d6ff57c074cd6c9e5f7b7cf095a46b 100644
--- a/tools/perf/page_sets/todomvc.py
+++ b/tools/perf/page_sets/todomvc.py
@@ -19,6 +19,8 @@ URL_LIST = [
('Vanilla JS', 'http://todomvc.com/examples/vanillajs'),
]
+INTERACTION_NAME = "Interaction.PageLoading"
Sami 2016/03/10 12:30:34 nit: Single quote strings please.
+
class TodoMVCPage(page_module.Page):
@@ -26,9 +28,20 @@ class TodoMVCPage(page_module.Page):
super(TodoMVCPage, self).__init__(
url=url, page_set=page_set, name=name,
shared_page_state_class=shared_page_state.SharedDesktopPageState)
+ self.script_to_evaluate_on_commit = (
+ "console.time('" + INTERACTION_NAME + "');")
Sami 2016/03/10 12:30:34 nit: How about creating an action_runner.Interacti
jochen (gone - plz use gerrit) 2016/03/10 14:09:22 there is no action runner that would live long eno
def RunPageInteractions(self, action_runner):
- pass
+ action_runner.ExecuteJavaScript(
+ """
+ this.hasRunRAF = 0;
+ requestAnimationFrame(function() {
jochen (gone - plz use gerrit) 2016/03/10 11:41:45 i wonder whether the page load interaction should
Sami 2016/03/10 12:30:34 I'm wondering if both are a little early for some
Camillo Bruni 2016/03/10 12:30:55 It should probably end with window.onLoad, since y
Camillo Bruni 2016/03/10 15:12:53 how about just waiting 4 seconds or so?
+ this.hasRunRAF = 1;
+ console.timeEnd('%s');
+ });
+ """ % INTERACTION_NAME
+ )
+ action_runner.WaitForJavaScriptCondition("this.hasRunRAF == 1")
class TodoMVCPageSet(story.StorySet):
« no previous file with comments | « tools/perf/benchmarks/v8.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698