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

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

Issue 1000203002: Add second batch JS benchmark and code generator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Beautification. Created 5 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
Index: tools/perf/page_sets/tough_scheduling_cases.py
diff --git a/tools/perf/page_sets/tough_scheduling_cases.py b/tools/perf/page_sets/tough_scheduling_cases.py
index 00fcb6eef492d92c42fd8f4ce2afb8502e7a42e0..9d8d5f72749d861442feede26e17188282386c2a 100644
--- a/tools/perf/page_sets/tough_scheduling_cases.py
+++ b/tools/perf/page_sets/tough_scheduling_cases.py
@@ -369,6 +369,36 @@ class SynchronizedScrollOffsetPage(ToughSchedulingCasesPage):
interaction.End()
+class SecondBatchJsPage(ToughSchedulingCasesPage):
+
+ """Why: For testing dynamically loading a large batch of Javascript and
+ running a part of it in response to user input.
+ """
+
+ def __init__(self, page_set, variant='medium'):
+ super(SecondBatchJsPage, self).__init__(
+ url='file://tough_scheduling_cases/second_batch_js.html?%s' % variant,
+ page_set=page_set)
+
+ def RunPageInteractions(self, action_runner):
+ # Do a dummy tap to warm up the synthetic tap code path.
+ action_runner.TapElement(selector='div[id="spinner"]')
+ # Begin the action immediately because we want the page to update smoothly
+ # even while resources are being loaded.
+ action_runner.WaitForJavaScriptCondition('window.__ready !== undefined')
+
+ interaction = action_runner.BeginGestureInteraction(
+ 'LoadAction', is_smooth=True)
+ action_runner.ClickElement(selector='input[id="load"]')
+ action_runner.WaitForJavaScriptCondition('window.__ready')
+ # Click one second after the resources have finished loading.
+ action_runner.Wait(1)
+ action_runner.TapElement(selector='input[id="run"]')
+ # Wait a little bit for things to settle.
+ action_runner.Wait(.3)
rmcilroy 2015/03/17 13:59:36 Should we wait on the actual JS to finish here (or
Sami 2015/03/18 14:05:32 Right, good point. I'll make the test signal when
+ interaction.End()
+
+
class ToughSchedulingCasesPageSet(page_set_module.PageSet):
"""Tough scheduler latency test cases."""
@@ -474,3 +504,7 @@ class ToughSchedulingCasesPageSet(page_set_module.PageSet):
page_set=self))
# Why: For measuring the latency of scroll-synchronized effects.
rmcilroy 2015/03/17 13:59:36 optional nit - I know it's not your patch, but cou
Sami 2015/03/18 14:05:32 Yeah, those look pretty dire. Fixed.
self.AddUserStory(SynchronizedScrollOffsetPage(page_set=self))
+ # Why: Test loading a large amount of Javascript.
+ self.AddUserStory(SecondBatchJsPage(page_set=self, variant='light'))
+ self.AddUserStory(SecondBatchJsPage(page_set=self, variant='medium'))
+ self.AddUserStory(SecondBatchJsPage(page_set=self, variant='heavy'))

Powered by Google App Engine
This is Rietveld 408576698