| 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 import story |
| 5 from telemetry.page import page as page | 6 from telemetry.page import page as page |
| 6 from telemetry.page import page_set as page_set | |
| 7 | |
| 8 | 7 |
| 9 archive_data_file_path = 'data/service_worker.json' | 8 archive_data_file_path = 'data/service_worker.json' |
| 10 | 9 |
| 11 | 10 |
| 12 class ServiceWorkerPageSet(page_set.PageSet): | 11 class ServiceWorkerPageSet(story.StorySet): |
| 13 """Page set of applications using ServiceWorker""" | 12 """Page set of applications using ServiceWorker""" |
| 14 | 13 |
| 15 def __init__(self): | 14 def __init__(self): |
| 16 super(ServiceWorkerPageSet, self).__init__( | 15 super(ServiceWorkerPageSet, self).__init__( |
| 17 archive_data_file=archive_data_file_path, | 16 archive_data_file=archive_data_file_path, |
| 18 bucket=page_set.PARTNER_BUCKET) | 17 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 19 | 18 |
| 20 # Why: the first application using ServiceWorker | 19 # Why: the first application using ServiceWorker |
| 21 # 1st time: registration | 20 # 1st time: registration |
| 22 self.AddUserStory(page.Page( | 21 self.AddUserStory(page.Page( |
| 23 'https://jakearchibald.github.io/trained-to-thrill/', self, | 22 'https://jakearchibald.github.io/trained-to-thrill/', self, |
| 24 name='first_load', make_javascript_deterministic=False)) | 23 name='first_load', make_javascript_deterministic=False)) |
| 25 # 2st time: 1st onfetch with caching | 24 # 2st time: 1st onfetch with caching |
| 26 self.AddUserStory(page.Page( | 25 self.AddUserStory(page.Page( |
| 27 'https://jakearchibald.github.io/trained-to-thrill/', self, | 26 'https://jakearchibald.github.io/trained-to-thrill/', self, |
| 28 name='second_load', make_javascript_deterministic=False)) | 27 name='second_load', make_javascript_deterministic=False)) |
| 29 # 3rd time: 2nd onfetch from cache | 28 # 3rd time: 2nd onfetch from cache |
| 30 self.AddUserStory(page.Page( | 29 self.AddUserStory(page.Page( |
| 31 'https://jakearchibald.github.io/trained-to-thrill/', self, | 30 'https://jakearchibald.github.io/trained-to-thrill/', self, |
| 32 name='third_load', make_javascript_deterministic=False)) | 31 name='third_load', make_javascript_deterministic=False)) |
| OLD | NEW |