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
3 # found in the LICENSE file.
4 from profile_creators
import profile_safe_url_list
5 from telemetry
.page
import page
as page_module
6 from telemetry
.page
import page_set
as page_set_module
9 class ProfileSafeUrlPage(page_module
.Page
):
10 def __init__(self
, url
, page_set
):
11 super(ProfileSafeUrlPage
, self
).__init
__(
14 credentials_path
= 'data/credentials.json')
15 self
.credentials
= 'google'
18 class ProfileSafeUrlsPageSet(page_set_module
.PageSet
):
19 """Safe urls used for profile generation."""
22 super(ProfileSafeUrlsPageSet
, self
).__init
__(
23 archive_data_file
='data/profile_safe_urls.json',
24 user_agent_type
='desktop',
25 bucket
=page_set_module
.PARTNER_BUCKET
)
27 # Only use the first 500 urls to prevent the .wpr files from getting too
29 safe_urls
= profile_safe_url_list
.GetShuffledSafeUrls()[0:500]
30 for safe_url
in safe_urls
:
31 self
.AddUserStory(ProfileSafeUrlPage(safe_url
, self
))