Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: tools/perf/profile_creators/small_profile_creator.py

Issue 323703003: [Telemetry] Fix profile generation after r275633. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 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 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 profile_creator 5 from telemetry.page import profile_creator
6 6
7 import page_sets 7 import page_sets
8 8
9 9
10 class SmallProfileCreator(profile_creator.ProfileCreator): 10 class SmallProfileCreator(profile_creator.ProfileCreator):
11 """ 11 """
12 Runs a browser through a series of operations to fill in a small test profile. 12 Runs a browser through a series of operations to fill in a small test profile.
13 """ 13 """
14 14
15 def __init__(self): 15 def __init__(self):
16 super(SmallProfileCreator, self).__init__() 16 super(SmallProfileCreator, self).__init__()
17 self._page_set = page_sets.Typical25() 17 self._page_set = page_sets.Typical25PageSet()
18 18
19 # Open all links in the same tab save for the last _NUM_TABS links which 19 # Open all links in the same tab save for the last _NUM_TABS links which
20 # are each opened in a new tab. 20 # are each opened in a new tab.
21 self._NUM_TABS = 5 21 self._NUM_TABS = 5
22 22
23 def TabForPage(self, page, browser): 23 def TabForPage(self, page, browser):
24 idx = page.page_set.pages.index(page) 24 idx = page.page_set.pages.index(page)
25 # The last _NUM_TABS pages open a new tab. 25 # The last _NUM_TABS pages open a new tab.
26 if idx <= (len(page.page_set.pages) - self._NUM_TABS): 26 if idx <= (len(page.page_set.pages) - self._NUM_TABS):
27 return browser.tabs[0] 27 return browser.tabs[0]
28 else: 28 else:
29 return browser.tabs.New() 29 return browser.tabs.New()
30 30
31 def MeasurePage(self, _, tab, results): 31 def MeasurePage(self, _, tab, results):
32 tab.WaitForDocumentReadyStateToBeComplete() 32 tab.WaitForDocumentReadyStateToBeComplete()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698