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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0ec2472f0aaa4a80c3d2ab3994739bb98796291d |
--- /dev/null |
+++ b/tools/perf/page_sets/system_health/multi_tab_stories.py |
@@ -0,0 +1,78 @@ |
+# Copyright 2017 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import py_utils |
+import logging |
+ |
+from page_sets.system_health import system_health_story |
+from page_sets.system_health import platforms |
+ |
+ |
+class _MultiTabStory(system_health_story.SystemHealthStory): |
+ ABSTRACT_STORY = True |
+ |
+ def RunNavigateSteps(self, action_runner): |
+ super(_MultiTabStory, self).RunNavigateSteps(action_runner) |
+ |
+ tabs = action_runner.tab.browser.tabs |
perezju
2017/03/02 14:33:12
High level question, do we really want to
1) open
vovoy
2017/03/02 18:02:29
I open all tabs and then wait for each tabs becaus
vovoy
2017/03/03 08:30:11
test command:
tools/perf/run_benchmark system_heal
perezju
2017/03/03 10:32:42
Sounds good. Thanks for checking!
|
+ |
+ for i in range(1, len(self.URL_LIST)): |
perezju
2017/03/02 14:33:11
for url in self.URL_LIST[1:]:
...
Also add a s
vovoy
2017/03/02 18:02:29
OK, will add comment
|
+ new_tab = tabs.New() |
+ new_tab.action_runner.Navigate(self.URL_LIST[i]) |
+ |
+ for i in range(len(self.URL_LIST)): |
perezju
2017/03/02 14:33:11
A possibility here could be:
for i, url in enumer
vovoy
2017/03/03 08:30:11
Done.
|
+ try: |
+ py_utils.WaitFor(tabs[i].HasReachedQuiescence, 15) |
perezju
2017/03/02 14:33:12
tabs[i].action_runner.WaitForNetworkQuiescence(15)
vovoy
2017/03/03 08:30:11
Done.
|
+ except py_utils.TimeoutException: |
+ logging.warning('HasReachedQuiescence timeout, url[%d]: %s' |
+ % (i, self.URL_LIST[i])) |
+ |
+ def RunPageInteractions(self, action_runner): |
+ tabs = action_runner.tab.browser.tabs |
+ for i in range(len(tabs)): |
perezju
2017/03/02 14:33:12
for tab in action_runner.tab.browser.tabs:
...
vovoy
2017/03/03 08:30:11
Done.
|
+ tabs[i].Activate() |
+ tabs[i].WaitForFrameToBeDisplayed() |
+ |
+ |
+class MultiTabTypical24Story(_MultiTabStory): |
+ NAME = 'multitab:typical24:typical24' |
nednguyen
2017/03/02 13:26:00
can you add:
TAGS = [story_tags.TABS_SWITCHING]?
perezju
2017/03/02 14:33:12
nit: I think 'multitab:misc:typical24' might be a
vovoy
2017/03/02 18:02:29
OK
vovoy
2017/03/03 08:30:11
Done.
|
+ URL_LIST = [ |
perezju
2017/03/02 14:33:11
Is this list coming from somewhere else? Could we
vovoy
2017/03/02 18:02:29
the list is coming from page_sets/typical_25.py
ma
nednguyen
2017/03/02 19:08:19
I think there is no need to share code here. As lo
|
+ # Why: Alexa games #48 |
+ 'http://www.nick.com/games', |
+ # Why: Alexa sports #45 |
+ 'http://www.rei.com/', |
+ # Why: Alexa sports #50 |
+ 'http://www.fifa.com/', |
+ # Why: Alexa shopping #41 |
+ 'http://www.gamestop.com/ps3', |
+ # Why: Alexa news #55 |
+ ('http://www.economist.com/news/science-and-technology/21573529-small-' |
+ 'models-cosmic-phenomena-are-shedding-light-real-thing-how-build'), |
+ # Why: Alexa news #67 |
+ 'http://www.theonion.com', |
+ 'http://arstechnica.com/', |
+ # Why: Alexa home #10 |
+ 'http://allrecipes.com/Recipe/Pull-Apart-Hot-Cross-Buns/Detail.aspx', |
+ 'http://www.html5rocks.com/en/', |
+ 'http://www.mlb.com/', |
+ 'http://gawker.com/5939683/based-on-a-true-story-is-a-rotten-lie-i-hope-you-never-believe', |
+ 'http://www.imdb.com/title/tt0910970/', |
+ 'http://www.flickr.com/search/?q=monkeys&f=hp', |
+ 'http://money.cnn.com/', |
+ 'http://www.nationalgeographic.com/', |
+ 'http://premierleague.com', |
+ 'http://www.osubeavers.com/', |
+ 'http://walgreens.com', |
+ 'http://colorado.edu', |
+ ('http://www.ticketmaster.com/JAY-Z-and-Justin-Timberlake-tickets/artist/' |
+ '1837448?brand=none&tm_link=tm_homeA_rc_name2'), |
+ # pylint: disable=line-too-long |
+ 'http://www.theverge.com/2013/3/5/4061684/inside-ted-the-smartest-bubble-in-the-world', |
+ 'http://www.airbnb.com/', |
+ 'http://www.ign.com/', |
+ # Why: Alexa health #25 |
+ 'http://www.fda.gov', |
+ ] |
+ URL = URL_LIST[0] |
+ SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |