| 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 from telemetry.page import cache_temperature as cache_temperature_module |
| 4 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
| 5 from telemetry.page import shared_page_state | 6 from telemetry.page import shared_page_state |
| 6 from telemetry import story | 7 from telemetry import story |
| 7 | 8 |
| 8 | 9 |
| 9 class IntlArFaHePage(page_module.Page): | 10 class IntlArFaHePage(page_module.Page): |
| 10 | 11 |
| 11 def __init__(self, url, page_set): | 12 def __init__(self, url, page_set, cache_temperature=None): |
| 12 super(IntlArFaHePage, self).__init__( | 13 super(IntlArFaHePage, self).__init__( |
| 13 url=url, page_set=page_set, | 14 url=url, page_set=page_set, |
| 14 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 15 shared_page_state_class=shared_page_state.SharedDesktopPageState, |
| 16 cache_temperature=cache_temperature) |
| 15 self.archive_data_file = 'data/intl_ar_fa_he.json' | 17 self.archive_data_file = 'data/intl_ar_fa_he.json' |
| 16 | 18 |
| 17 | 19 |
| 18 class IntlArFaHePageSet(story.StorySet): | 20 class IntlArFaHePageSet(story.StorySet): |
| 19 | 21 |
| 20 """ Popular pages in right-to-left languages Arabic, Farsi and Hebrew. """ | 22 """ Popular pages in right-to-left languages Arabic, Farsi and Hebrew. """ |
| 21 | 23 |
| 22 def __init__(self): | 24 def __init__(self, cache_temperatures=None): |
| 23 super(IntlArFaHePageSet, self).__init__( | 25 super(IntlArFaHePageSet, self).__init__( |
| 24 archive_data_file='data/intl_ar_fa_he.json', | 26 archive_data_file='data/intl_ar_fa_he.json', |
| 25 cloud_storage_bucket=story.PARTNER_BUCKET) | 27 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 28 if cache_temperatures is None: |
| 29 cache_temperatures = [cache_temperature_module.ANY] |
| 26 | 30 |
| 27 urls_list = [ | 31 urls_list = [ |
| 28 'http://msn.co.il/', | 32 'http://msn.co.il/', |
| 29 'http://ynet.co.il/', | 33 'http://ynet.co.il/', |
| 30 'http://www.islamweb.net/', | 34 'http://www.islamweb.net/', |
| 31 'http://farsnews.com/', | 35 'http://farsnews.com/', |
| 32 'http://www.masrawy.com/', | 36 'http://www.masrawy.com/', |
| 33 'http://www.startimes.com/f.aspx', | 37 'http://www.startimes.com/f.aspx', |
| 34 'http://www.aljayyash.net/', | 38 'http://www.aljayyash.net/', |
| 35 'http://www.google.com.sa/' | 39 'http://www.google.com.sa/' |
| 36 ] | 40 ] |
| 37 | 41 |
| 38 for url in urls_list: | 42 for url in urls_list: |
| 39 self.AddStory(IntlArFaHePage(url, self)) | 43 for temp in cache_temperatures: |
| 44 self.AddStory(IntlArFaHePage(url, self, cache_temperature=temp)) |
| OLD | NEW |