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

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: updates 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..4f095ecf29f153fe2064930873207a57a04740df 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.AppLoad'
+
class TodoMVCPage(page_module.Page):
@@ -26,9 +28,27 @@ 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)
+ # TODO(jochen): This interaction does not include the
+ # WindowProxy::initialize portion before the commit. To fix this, we'll
+ # have to migrate to TBMv2.
+ self.script_to_evaluate_on_commit = (
+ 'console.time("%s");' % INTERACTION_NAME)
def RunPageInteractions(self, action_runner):
- pass
+ action_runner.ExecuteJavaScript(
+ """
+ this.becameIdle = false;
+ this.idleCallback = function(deadline) {
+ if (deadline.timeRemaining() > 20)
+ this.becameIdle = true;
+ else
+ requestIdleCallback(this.idleCallback);
+ };
+ requestIdleCallback(this.idleCallback);
+ """
+ )
+ action_runner.WaitForJavaScriptCondition('this.becameIdle === true')
+ action_runner.ExecuteJavaScript('console.timeEnd("%s");' % INTERACTION_NAME)
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