| 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 | 4 |
| 5 from page_sets import webgl_supported_shared_state | 5 from page_sets import webgl_supported_shared_state |
| 6 from telemetry import page as page_module | 6 from telemetry import page as page_module |
| 7 from telemetry import story | 7 from telemetry import story |
| 8 | 8 |
| 9 STARTUP_SCRIPT = ''' | 9 STARTUP_SCRIPT = ''' |
| 10 window.benchmarkStarted =false; | 10 window.benchmarkStarted =false; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 cloud_storage_bucket=story.PARTNER_BUCKET) | 45 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 46 self.AddStory(OortOnlinePage(self)) | 46 self.AddStory(OortOnlinePage(self)) |
| 47 | 47 |
| 48 class OortOnlineTBMPage(OortOnlinePage): | 48 class OortOnlineTBMPage(OortOnlinePage): |
| 49 def __init__(self, page_set): | 49 def __init__(self, page_set): |
| 50 super(OortOnlineTBMPage, self).__init__(page_set=page_set) | 50 super(OortOnlineTBMPage, self).__init__(page_set=page_set) |
| 51 | 51 |
| 52 def RunPageInteractions(self, action_runner): | 52 def RunPageInteractions(self, action_runner): |
| 53 WAIT_TIME_IN_SECONDS = 2 | 53 WAIT_TIME_IN_SECONDS = 2 |
| 54 RUN_TIME_IN_SECONDS = 20 | 54 RUN_TIME_IN_SECONDS = 20 |
| 55 action_runner.WaitForJavaScriptCondition2('window.benchmarkStarted') | 55 action_runner.WaitForJavaScriptCondition('window.benchmarkStarted') |
| 56 # Perform GC to get rid of start-up garbage. | 56 # Perform GC to get rid of start-up garbage. |
| 57 action_runner.ForceGarbageCollection() | 57 action_runner.ForceGarbageCollection() |
| 58 with action_runner.CreateInteraction('Begin'): | 58 with action_runner.CreateInteraction('Begin'): |
| 59 action_runner.tab.browser.DumpMemory() | 59 action_runner.tab.browser.DumpMemory() |
| 60 # Skip the first few seconds to get more stable frame times. | 60 # Skip the first few seconds to get more stable frame times. |
| 61 action_runner.Wait(WAIT_TIME_IN_SECONDS) | 61 action_runner.Wait(WAIT_TIME_IN_SECONDS) |
| 62 with action_runner.CreateInteraction('Running'): | 62 with action_runner.CreateInteraction('Running'): |
| 63 # We cannot wait until benchmarkFinished because true because the result | 63 # We cannot wait until benchmarkFinished because true because the result |
| 64 # screen does not update, which affects frame-time discrepancy | 64 # screen does not update, which affects frame-time discrepancy |
| 65 # computation. Instead we stop based on timer. | 65 # computation. Instead we stop based on timer. |
| 66 action_runner.Wait(RUN_TIME_IN_SECONDS) | 66 action_runner.Wait(RUN_TIME_IN_SECONDS) |
| 67 with action_runner.CreateInteraction('End'): | 67 with action_runner.CreateInteraction('End'): |
| 68 action_runner.tab.browser.DumpMemory() | 68 action_runner.tab.browser.DumpMemory() |
| 69 | 69 |
| 70 class OortOnlineTBMPageSet(story.StorySet): | 70 class OortOnlineTBMPageSet(story.StorySet): |
| 71 """Oort Online WebGL benchmark for TBM. | 71 """Oort Online WebGL benchmark for TBM. |
| 72 URL: http://oortonline.gl/#run | 72 URL: http://oortonline.gl/#run |
| 73 Info: http://v8project.blogspot.de/2015/10/jank-busters-part-one.html | 73 Info: http://v8project.blogspot.de/2015/10/jank-busters-part-one.html |
| 74 """ | 74 """ |
| 75 | 75 |
| 76 def __init__(self): | 76 def __init__(self): |
| 77 super(OortOnlineTBMPageSet, self).__init__( | 77 super(OortOnlineTBMPageSet, self).__init__( |
| 78 archive_data_file='data/oortonline.json', | 78 archive_data_file='data/oortonline.json', |
| 79 cloud_storage_bucket=story.PARTNER_BUCKET) | 79 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 80 self.AddStory(OortOnlineTBMPage(self)) | 80 self.AddStory(OortOnlineTBMPage(self)) |
| OLD | NEW |