Chromium Code Reviews| 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')) |