1 # Copyright 2013 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.
7 from profile_creators
import fast_navigation_profile_extender
10 class SmallProfileExtender(
11 fast_navigation_profile_extender
.FastNavigationProfileExtender
):
12 """Creates a small profile by performing 25 navigations."""
14 def __init__(self
, finder_options
):
15 # Use exactly 5 tabs to generate the profile. This is because consumers of
16 # this profile will perform a session restore, and expect 5 restored tabs.
17 maximum_batch_size
= 5
18 super(SmallProfileExtender
, self
).__init
__(
19 finder_options
, maximum_batch_size
)
21 # Get the list of urls from the typical 25 page set.
22 self
._page
_set
= page_sets
.Typical25PageSet()
24 for story
in self
._page
_set
.stories
:
25 urls
.append(story
.url
)
26 self
._navigation
_urls
= urls
28 def GetUrlIterator(self
):
29 """Superclass override."""
30 return iter(self
._navigation
_urls
)
32 def ShouldExitAfterBatchNavigation(self
):
33 """Superclass override."""
36 def WebPageReplayArchivePath(self
):
37 """Superclass override."""
38 return self
._page
_set
.WprFilePathForStory(
39 self
._page
_set
.stories
[0])
41 def FetchWebPageReplayArchives(self
):
42 """Superclass override."""
43 self
._page
_set
.wpr_archive_info
.DownloadArchivesIfNeeded()