OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2017 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 | |
5 import py_utils | |
6 import logging | |
7 | |
8 from page_sets.system_health import system_health_story | |
9 from page_sets.system_health import platforms | |
10 | |
11 | |
12 class _MultiTabStory(system_health_story.SystemHealthStory): | |
13 ABSTRACT_STORY = True | |
14 | |
15 def RunNavigateSteps(self, action_runner): | |
16 super(_MultiTabStory, self).RunNavigateSteps(action_runner) | |
17 | |
18 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!
| |
19 | |
20 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
| |
21 new_tab = tabs.New() | |
22 new_tab.action_runner.Navigate(self.URL_LIST[i]) | |
23 | |
24 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.
| |
25 try: | |
26 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.
| |
27 except py_utils.TimeoutException: | |
28 logging.warning('HasReachedQuiescence timeout, url[%d]: %s' | |
29 % (i, self.URL_LIST[i])) | |
30 | |
31 def RunPageInteractions(self, action_runner): | |
32 tabs = action_runner.tab.browser.tabs | |
33 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.
| |
34 tabs[i].Activate() | |
35 tabs[i].WaitForFrameToBeDisplayed() | |
36 | |
37 | |
38 class MultiTabTypical24Story(_MultiTabStory): | |
39 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.
| |
40 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
| |
41 # Why: Alexa games #48 | |
42 'http://www.nick.com/games', | |
43 # Why: Alexa sports #45 | |
44 'http://www.rei.com/', | |
45 # Why: Alexa sports #50 | |
46 'http://www.fifa.com/', | |
47 # Why: Alexa shopping #41 | |
48 'http://www.gamestop.com/ps3', | |
49 # Why: Alexa news #55 | |
50 ('http://www.economist.com/news/science-and-technology/21573529-small-' | |
51 'models-cosmic-phenomena-are-shedding-light-real-thing-how-build'), | |
52 # Why: Alexa news #67 | |
53 'http://www.theonion.com', | |
54 'http://arstechnica.com/', | |
55 # Why: Alexa home #10 | |
56 'http://allrecipes.com/Recipe/Pull-Apart-Hot-Cross-Buns/Detail.aspx', | |
57 'http://www.html5rocks.com/en/', | |
58 'http://www.mlb.com/', | |
59 'http://gawker.com/5939683/based-on-a-true-story-is-a-rotten-lie-i-hope-you- never-believe', | |
60 'http://www.imdb.com/title/tt0910970/', | |
61 'http://www.flickr.com/search/?q=monkeys&f=hp', | |
62 'http://money.cnn.com/', | |
63 'http://www.nationalgeographic.com/', | |
64 'http://premierleague.com', | |
65 'http://www.osubeavers.com/', | |
66 'http://walgreens.com', | |
67 'http://colorado.edu', | |
68 ('http://www.ticketmaster.com/JAY-Z-and-Justin-Timberlake-tickets/artist/' | |
69 '1837448?brand=none&tm_link=tm_homeA_rc_name2'), | |
70 # pylint: disable=line-too-long | |
71 'http://www.theverge.com/2013/3/5/4061684/inside-ted-the-smartest-bubble-in- the-world', | |
72 'http://www.airbnb.com/', | |
73 'http://www.ign.com/', | |
74 # Why: Alexa health #25 | |
75 'http://www.fda.gov', | |
76 ] | |
77 URL = URL_LIST[0] | |
78 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | |
OLD | NEW |