| 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 telemetry.page import page as page | 5 from telemetry.page import page as page |
| 6 from telemetry import story | 6 from telemetry import story |
| 7 | 7 |
| 8 | 8 |
| 9 class ServiceWorkerBenchmarkPage(page.Page): | 9 class ServiceWorkerBenchmarkPage(page.Page): |
| 10 """Page for workload to measure some specific functions in JS""" | 10 """Page for workload to measure some specific functions in JS""" |
| 11 | 11 |
| 12 def RunNavigateSteps(self, action_runner): | 12 def RunNavigateSteps(self, action_runner): |
| 13 super(ServiceWorkerBenchmarkPage, self).RunNavigateSteps(action_runner) | 13 super(ServiceWorkerBenchmarkPage, self).RunNavigateSteps(action_runner) |
| 14 action_runner.WaitForJavaScriptCondition2('window.done') | 14 action_runner.WaitForJavaScriptCondition('window.done') |
| 15 | 15 |
| 16 | 16 |
| 17 class ServiceWorkerMicroBenchmarkPageSet(story.StorySet): | 17 class ServiceWorkerMicroBenchmarkPageSet(story.StorySet): |
| 18 """Page set for micro benchmarking of each functions with ServiceWorker""" | 18 """Page set for micro benchmarking of each functions with ServiceWorker""" |
| 19 | 19 |
| 20 def __init__(self): | 20 def __init__(self): |
| 21 super(ServiceWorkerMicroBenchmarkPageSet, self).__init__( | 21 super(ServiceWorkerMicroBenchmarkPageSet, self).__init__( |
| 22 archive_data_file='data/service_worker_micro_benchmark.json', | 22 archive_data_file='data/service_worker_micro_benchmark.json', |
| 23 cloud_storage_bucket=story.PUBLIC_BUCKET) | 23 cloud_storage_bucket=story.PUBLIC_BUCKET) |
| 24 | 24 |
| 25 # pylint: disable=line-too-long | 25 # pylint: disable=line-too-long |
| 26 # The latest code of localhost:8091 is from: | 26 # The latest code of localhost:8091 is from: |
| 27 # https://github.com/amiq11/Service-Worker-Performance/tree/fix-flakyness | 27 # https://github.com/amiq11/Service-Worker-Performance/tree/fix-flakyness |
| 28 # (rev: e6b3f604674209a30e4cf416a18cb8be3b991abd) | 28 # (rev: e6b3f604674209a30e4cf416a18cb8be3b991abd) |
| 29 # TODO(falken): House the code in GoogleChrome's GitHub repository. | 29 # TODO(falken): House the code in GoogleChrome's GitHub repository. |
| 30 # pylint: enable=C0301 | 30 # pylint: enable=C0301 |
| 31 # Why: to measure performance of many concurrent fetches | 31 # Why: to measure performance of many concurrent fetches |
| 32 self.AddStory(ServiceWorkerBenchmarkPage( | 32 self.AddStory(ServiceWorkerBenchmarkPage( |
| 33 'http://localhost:8091/index.html', self, | 33 'http://localhost:8091/index.html', self, |
| 34 make_javascript_deterministic=False)) | 34 make_javascript_deterministic=False)) |
| OLD | NEW |