OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
5 from telemetry.page import shared_page_state | 5 from telemetry.page import shared_page_state |
6 | 6 |
7 | 7 |
8 class KeyMobileSitesPage(page_module.Page): | 8 class KeyMobileSitesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set, name='', labels=None): | 10 def __init__(self, url, page_set, name='', labels=None): |
(...skipping 21 matching lines...) Expand all Loading... |
32 'document.body.scrollHeight > 2560') | 32 'document.body.scrollHeight > 2560') |
33 | 33 |
34 | 34 |
35 | 35 |
36 class TheVergeArticlePage(KeyMobileSitesPage): | 36 class TheVergeArticlePage(KeyMobileSitesPage): |
37 | 37 |
38 """ Why: Top tech blog """ | 38 """ Why: Top tech blog """ |
39 | 39 |
40 def __init__(self, page_set): | 40 def __init__(self, page_set): |
41 super(TheVergeArticlePage, self).__init__( | 41 super(TheVergeArticlePage, self).__init__( |
42 # pylint: disable=C0301 | 42 # pylint: disable=line-too-long |
43 url='http://www.theverge.com/2012/10/28/3568746/amazon-7-inch-fire-hd-ipad
-mini-ad-ballsy', | 43 url='http://www.theverge.com/2012/10/28/3568746/amazon-7-inch-fire-hd-ipad
-mini-ad-ballsy', |
44 page_set=page_set) | 44 page_set=page_set) |
45 | 45 |
46 def RunNavigateSteps(self, action_runner): | 46 def RunNavigateSteps(self, action_runner): |
47 super(TheVergeArticlePage, self).RunNavigateSteps(action_runner) | 47 super(TheVergeArticlePage, self).RunNavigateSteps(action_runner) |
48 action_runner.WaitForJavaScriptCondition( | 48 action_runner.WaitForJavaScriptCondition( |
49 'window.Chorus !== undefined &&' | 49 'window.Chorus !== undefined &&' |
50 'window.Chorus.Comments !== undefined &&' | 50 'window.Chorus.Comments !== undefined &&' |
51 'window.Chorus.Comments.Json !== undefined &&' | 51 'window.Chorus.Comments.Json !== undefined &&' |
52 '(window.Chorus.Comments.loaded ||' | 52 '(window.Chorus.Comments.loaded ||' |
53 ' window.Chorus.Comments.Json.load_comments())') | 53 ' window.Chorus.Comments.Json.load_comments())') |
54 | 54 |
55 | 55 |
56 class CnnArticlePage(KeyMobileSitesPage): | 56 class CnnArticlePage(KeyMobileSitesPage): |
57 | 57 |
58 """ Why: Top news site """ | 58 """ Why: Top news site """ |
59 | 59 |
60 def __init__(self, page_set): | 60 def __init__(self, page_set): |
61 super(CnnArticlePage, self).__init__( | 61 super(CnnArticlePage, self).__init__( |
62 # pylint: disable=C0301 | 62 # pylint: disable=line-too-long |
63 url='http://www.cnn.com/2012/10/03/politics/michelle-obama-debate/index.ht
ml', | 63 url='http://www.cnn.com/2012/10/03/politics/michelle-obama-debate/index.ht
ml', |
64 page_set=page_set) | 64 page_set=page_set) |
65 | 65 |
66 def RunNavigateSteps(self, action_runner): | 66 def RunNavigateSteps(self, action_runner): |
67 super(CnnArticlePage, self).RunNavigateSteps(action_runner) | 67 super(CnnArticlePage, self).RunNavigateSteps(action_runner) |
68 action_runner.Wait(8) | 68 action_runner.Wait(8) |
69 | 69 |
70 | 70 |
71 | 71 |
72 class FacebookPage(KeyMobileSitesPage): | 72 class FacebookPage(KeyMobileSitesPage): |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 'document.getElementById("profile-view-scroller") !== null') | 116 'document.getElementById("profile-view-scroller") !== null') |
117 | 117 |
118 | 118 |
119 | 119 |
120 class YahooAnswersPage(KeyMobileSitesPage): | 120 class YahooAnswersPage(KeyMobileSitesPage): |
121 | 121 |
122 """ Why: #1 Alexa reference """ | 122 """ Why: #1 Alexa reference """ |
123 | 123 |
124 def __init__(self, page_set): | 124 def __init__(self, page_set): |
125 super(YahooAnswersPage, self).__init__( | 125 super(YahooAnswersPage, self).__init__( |
126 # pylint: disable=C0301 | 126 # pylint: disable=line-too-long |
127 url='http://answers.yahoo.com/question/index?qid=20110117024343AAopj8f', | 127 url='http://answers.yahoo.com/question/index?qid=20110117024343AAopj8f', |
128 page_set=page_set) | 128 page_set=page_set) |
129 | 129 |
130 def RunNavigateSteps(self, action_runner): | 130 def RunNavigateSteps(self, action_runner): |
131 super(YahooAnswersPage, self).RunNavigateSteps(action_runner) | 131 super(YahooAnswersPage, self).RunNavigateSteps(action_runner) |
132 action_runner.WaitForElement(text='Other Answers (1 - 20 of 149)') | 132 action_runner.WaitForElement(text='Other Answers (1 - 20 of 149)') |
133 action_runner.ClickElement(text='Other Answers (1 - 20 of 149)') | 133 action_runner.ClickElement(text='Other Answers (1 - 20 of 149)') |
134 | 134 |
135 | 135 |
136 class GmailPage(KeyMobileSitesPage): | 136 class GmailPage(KeyMobileSitesPage): |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 class AmazonNicolasCagePage(KeyMobileSitesPage): | 226 class AmazonNicolasCagePage(KeyMobileSitesPage): |
227 | 227 |
228 """ | 228 """ |
229 Why: #1 world commerce website by visits; #3 commerce in the US by time spent | 229 Why: #1 world commerce website by visits; #3 commerce in the US by time spent |
230 """ | 230 """ |
231 | 231 |
232 def __init__(self, page_set): | 232 def __init__(self, page_set): |
233 super(AmazonNicolasCagePage, self).__init__( | 233 super(AmazonNicolasCagePage, self).__init__( |
234 url='http://www.amazon.com/gp/aw/s/ref=is_box_?k=nicolas+cage', | 234 url='http://www.amazon.com/gp/aw/s/ref=is_box_?k=nicolas+cage', |
235 page_set=page_set) | 235 page_set=page_set) |
OLD | NEW |