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

Unified Diff: tools/perf/page_sets/system_health/multi_tab_stories.py

Issue 2829423002: Fix tab_switching to support flag --pageset-repeat properly (Closed)
Patch Set: only tab switching on the last pageset Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/tab_switching.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/system_health/multi_tab_stories.py
diff --git a/tools/perf/page_sets/system_health/multi_tab_stories.py b/tools/perf/page_sets/system_health/multi_tab_stories.py
index a9ab0c741024d2fa37508cdd7157ea010c4e384d..5583ad63f1c8ba70b67dbd142a4946a5b155ff77 100644
--- a/tools/perf/page_sets/system_health/multi_tab_stories.py
+++ b/tools/perf/page_sets/system_health/multi_tab_stories.py
@@ -15,16 +15,26 @@ from telemetry import benchmark
class MultiTabStory(system_health_story.SystemHealthStory):
ABSTRACT_STORY = True
+ def __init__(self, story_set, take_memory_measurement):
+ super(MultiTabStory, self).__init__(story_set, take_memory_measurement)
+ self._pageset_repeat = 1
+
+ def Run(self, shared_state):
+ finder_options = getattr(shared_state, '_finder_options')
+ self._pageset_repeat = finder_options.pageset_repeat
+ super(MultiTabStory, self).Run(shared_state)
+
def RunNavigateSteps(self, action_runner):
tabs = action_runner.tab.browser.tabs
- # No need to create the first tab as there is already one
- # when the browser is ready,
- if self.URL_LIST:
- action_runner.Navigate(self.URL_LIST[0])
- for url in self.URL_LIST[1:]:
- new_tab = tabs.New()
- new_tab.action_runner.Navigate(url)
+ # If this is the first pageset, don't have to create the first tab
+ # as there is already one when the browser is ready,
+ for i, url in enumerate(self.URL_LIST):
+ if i == 0 and len(action_runner.tab.browser.tabs) == 1:
+ action_runner.Navigate(url)
+ else:
+ new_tab = tabs.New()
+ new_tab.action_runner.Navigate(url)
for i, url in enumerate(self.URL_LIST):
try:
@@ -34,6 +44,13 @@ class MultiTabStory(system_health_story.SystemHealthStory):
% (i, url))
def RunPageInteractions(self, action_runner):
+ # if tab switching on every pageset, the metrics data would be a mix of
+ # tab switching on different tab counts and is hard to analyze. only
+ # tab switching on the last pageset
+ if self._pageset_repeat != 1 and len(action_runner.tab.browser.tabs) != \
+ len(self.URL_LIST) * self._pageset_repeat:
+ return
+
for tab in action_runner.tab.browser.tabs:
tab.Activate()
tab.WaitForFrameToBeDisplayed()
« no previous file with comments | « tools/perf/measurements/tab_switching.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698