OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
5 from telemetry.page import shared_page_state | 5 from telemetry.page import shared_page_state |
6 from telemetry import story | 6 from telemetry import story |
7 | 7 |
8 | 8 |
9 class ToughSchedulingCasesPage(page_module.Page): | 9 class ToughSchedulingCasesPage(page_module.Page): |
10 | 10 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 def __init__(self, page_set, variant='medium'): | 370 def __init__(self, page_set, variant='medium'): |
371 super(SecondBatchJsPage, self).__init__( | 371 super(SecondBatchJsPage, self).__init__( |
372 url='file://tough_scheduling_cases/second_batch_js.html?%s' % variant, | 372 url='file://tough_scheduling_cases/second_batch_js.html?%s' % variant, |
373 page_set=page_set) | 373 page_set=page_set) |
374 | 374 |
375 def RunPageInteractions(self, action_runner): | 375 def RunPageInteractions(self, action_runner): |
376 # Do a dummy tap to warm up the synthetic tap code path. | 376 # Do a dummy tap to warm up the synthetic tap code path. |
377 action_runner.TapElement(selector='div[id="spinner"]') | 377 action_runner.TapElement(selector='div[id="spinner"]') |
378 # Begin the action immediately because we want the page to update smoothly | 378 # Begin the action immediately because we want the page to update smoothly |
379 # even while resources are being loaded. | 379 # even while resources are being loaded. |
380 action_runner.WaitForJavaScriptCondition2('window.__ready !== undefined') | 380 action_runner.WaitForJavaScriptCondition('window.__ready !== undefined') |
381 | 381 |
382 with action_runner.CreateGestureInteraction('LoadAction'): | 382 with action_runner.CreateGestureInteraction('LoadAction'): |
383 action_runner.ExecuteJavaScript2('kickOffLoading()') | 383 action_runner.ExecuteJavaScript('kickOffLoading()') |
384 action_runner.WaitForJavaScriptCondition2('window.__ready') | 384 action_runner.WaitForJavaScriptCondition('window.__ready') |
385 # Click one second after the resources have finished loading. | 385 # Click one second after the resources have finished loading. |
386 action_runner.Wait(1) | 386 action_runner.Wait(1) |
387 action_runner.TapElement(selector='input[id="run"]') | 387 action_runner.TapElement(selector='input[id="run"]') |
388 # Wait for the test to complete. | 388 # Wait for the test to complete. |
389 action_runner.WaitForJavaScriptCondition2('window.__finished') | 389 action_runner.WaitForJavaScriptCondition('window.__finished') |
390 | 390 |
391 | 391 |
392 class ToughSchedulingCasesPageSet(story.StorySet): | 392 class ToughSchedulingCasesPageSet(story.StorySet): |
393 | 393 |
394 """Tough scheduler latency test cases.""" | 394 """Tough scheduler latency test cases.""" |
395 | 395 |
396 def __init__(self): | 396 def __init__(self): |
397 super(ToughSchedulingCasesPageSet, self).__init__( | 397 super(ToughSchedulingCasesPageSet, self).__init__( |
398 archive_data_file='data/tough_scheduling_cases.json', | 398 archive_data_file='data/tough_scheduling_cases.json', |
399 cloud_storage_bucket=story.INTERNAL_BUCKET) | 399 cloud_storage_bucket=story.INTERNAL_BUCKET) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 desktop=True, | 490 desktop=True, |
491 slow_handler=True, | 491 slow_handler=True, |
492 bounce=True, | 492 bounce=True, |
493 page_set=self)) | 493 page_set=self)) |
494 # Why: For measuring the latency of scroll-synchronized effects. | 494 # Why: For measuring the latency of scroll-synchronized effects. |
495 self.AddStory(SynchronizedScrollOffsetPage(page_set=self)) | 495 self.AddStory(SynchronizedScrollOffsetPage(page_set=self)) |
496 # Why: Test loading a large amount of Javascript. | 496 # Why: Test loading a large amount of Javascript. |
497 self.AddStory(SecondBatchJsPage(page_set=self, variant='light')) | 497 self.AddStory(SecondBatchJsPage(page_set=self, variant='light')) |
498 self.AddStory(SecondBatchJsPage(page_set=self, variant='medium')) | 498 self.AddStory(SecondBatchJsPage(page_set=self, variant='medium')) |
499 self.AddStory(SecondBatchJsPage(page_set=self, variant='heavy')) | 499 self.AddStory(SecondBatchJsPage(page_set=self, variant='heavy')) |
OLD | NEW |