OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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_module | 5 from telemetry.page import page as page_module |
6 from telemetry import story | 6 from telemetry import story |
7 | 7 |
8 # Even though we don't specialize page behavior directly, we have to define our | 8 # Even though we don't specialize page behavior directly, we have to define our |
9 # own page class so that |story.serving_dir| fetched from the StorySet will | 9 # own page class so that |story.serving_dir| fetched from the StorySet will |
10 # reflect the path to our containing directory, under which we serve local files | 10 # reflect the path to our containing directory, under which we serve local files |
11 # for recording. See also initialization of |base_dir| in telemetry's page.Page | 11 # for recording. See also initialization of |base_dir| in telemetry's page.Page |
12 # constructor, which is in turn referenced by |file_path_url|. | 12 # constructor, which is in turn referenced by |file_path_url|. |
13 class PartialInvalidationCasesPage(page_module.Page): | 13 class PartialInvalidationCasesPage(page_module.Page): |
14 | 14 |
15 def __init__(self, url, page_set): | 15 def __init__(self, url, page_set): |
16 super(PartialInvalidationCasesPage, self).__init__( | 16 super(PartialInvalidationCasesPage, self).__init__( |
17 url=url, page_set=page_set) | 17 url=url, page_set=page_set, name=url.split('/')[-1]) |
18 | 18 |
19 | 19 |
20 class PartialInvalidationCasesPageSet(story.StorySet): | 20 class PartialInvalidationCasesPageSet(story.StorySet): |
21 | 21 |
22 """ Page set consisting of pages specialized for partial invalidation, | 22 """ Page set consisting of pages specialized for partial invalidation, |
23 for example, pages with many elements. """ | 23 for example, pages with many elements. """ |
24 | 24 |
25 def __init__(self): | 25 def __init__(self): |
26 super(PartialInvalidationCasesPageSet, self).__init__( | 26 super(PartialInvalidationCasesPageSet, self).__init__( |
27 cloud_storage_bucket=story.PARTNER_BUCKET) | 27 cloud_storage_bucket=story.PARTNER_BUCKET, verify_names=True) |
28 | 28 |
29 other_urls = [ | 29 other_urls = [ |
30 # Why: Reduced test case similar to the single page html5 spec wherein | 30 # Why: Reduced test case similar to the single page html5 spec wherein |
31 # we saw a performance regression demonstrable via a small partial | 31 # we saw a performance regression demonstrable via a small partial |
32 # invalidation. | 32 # invalidation. |
33 'file://partial_invalidation_cases/800_relpos_divs.html', | 33 'file://partial_invalidation_cases/800_relpos_divs.html', |
34 ] | 34 ] |
35 | 35 |
36 for url in other_urls: | 36 for url in other_urls: |
37 self.AddStory(PartialInvalidationCasesPage(url, self)) | 37 self.AddStory(PartialInvalidationCasesPage(url, self)) |
OLD | NEW |