| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import story | 5 from telemetry import story |
| 6 | 6 |
| 7 | 7 |
| 8 class ToughPathRenderingCasesPage(page_module.Page): | 8 class ToughPathRenderingCasesPage(page_module.Page): |
| 9 | 9 |
| 10 def RunPageInteractions(self, action_runner): | 10 def RunPageInteractions(self, action_runner): |
| 11 with action_runner.CreateInteraction('ClickStart'): | 11 with action_runner.CreateInteraction('ClickStart'): |
| 12 action_runner.Wait(10) | 12 action_runner.Wait(10) |
| 13 | 13 |
| 14 | 14 |
| 15 class ChalkboardPage(page_module.Page): | 15 class ChalkboardPage(page_module.Page): |
| 16 | 16 |
| 17 def RunPageInteractions(self, action_runner): | 17 def RunPageInteractions(self, action_runner): |
| 18 action_runner.tab.WaitForDocumentReadyStateToBeComplete() | |
| 19 with action_runner.CreateInteraction('ClickStart'): | 18 with action_runner.CreateInteraction('ClickStart'): |
| 20 action_runner.EvaluateJavaScript( | 19 action_runner.EvaluateJavaScript( |
| 21 'document.getElementById("StartButton").click()') | 20 'document.getElementById("StartButton").click()') |
| 22 action_runner.WaitForJavaScriptCondition( | 21 action_runner.Wait(20) |
| 23 'document.getElementById("FinalTime").innerText != ""') | |
| 24 | 22 |
| 25 class ToughPathRenderingCasesPageSet(story.StorySet): | 23 class ToughPathRenderingCasesPageSet(story.StorySet): |
| 26 | 24 |
| 27 """ | 25 """ |
| 28 Description: Self-driven path rendering examples | 26 Description: Self-driven path rendering examples |
| 29 """ | 27 """ |
| 30 | 28 |
| 31 def __init__(self): | 29 def __init__(self): |
| 32 super(ToughPathRenderingCasesPageSet, self).__init__( | 30 super(ToughPathRenderingCasesPageSet, self).__init__( |
| 33 archive_data_file='data/tough_path_rendering_cases.json', | 31 archive_data_file='data/tough_path_rendering_cases.json', |
| 34 cloud_storage_bucket=story.PARTNER_BUCKET) | 32 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 35 | 33 |
| 36 urls_list = [ | 34 urls_list = [ |
| 37 'http://www.craftymind.com/factory/guimark2/HTML5ChartingTest.html' | 35 'http://www.craftymind.com/factory/guimark2/HTML5ChartingTest.html' |
| 38 ] | 36 ] |
| 39 | 37 |
| 40 for url in urls_list: | 38 for url in urls_list: |
| 41 self.AddStory(ToughPathRenderingCasesPage(url, self)) | 39 self.AddStory(ToughPathRenderingCasesPage(url, self)) |
| 42 | 40 |
| 43 # Chalkboard content linked from | 41 # Chalkboard content linked from |
| 44 # http://ie.microsoft.com/testdrive/Performance/Chalkboard/. | 42 # http://ie.microsoft.com/testdrive/Performance/Chalkboard/. |
| 45 self.AddStory(ChalkboardPage( | 43 self.AddStory(ChalkboardPage( |
| 46 'https://testdrive-archive.azurewebsites.net/performance/chalkboard/', s
elf)) | 44 'https://testdrive-archive.azurewebsites.net/performance/chalkboard/', s
elf)) |
| OLD | NEW |