| 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 page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 def _GetCurrentLocation(action_runner): | 8 def _GetCurrentLocation(action_runner): |
| 9 return action_runner.EvaluateJavaScript('document.location.href') | 9 return action_runner.EvaluateJavaScript('document.location.href') |
| 10 | 10 |
| 11 | 11 |
| 12 def _WaitForLocationChange(action_runner, old_href): | 12 def _WaitForLocationChange(action_runner, old_href): |
| 13 action_runner.WaitForJavaScriptCondition( | 13 action_runner.WaitForJavaScriptCondition( |
| 14 'document.location.href != "%s"' % old_href) | 14 'document.location.href != "%s"' % old_href) |
| 15 | 15 |
| 16 | 16 |
| 17 class Top25Page(page_module.Page): | 17 class Top25Page(page_module.Page): |
| 18 | 18 |
| 19 def __init__(self, url, page_set, name=''): | 19 def __init__(self, url, page_set, name='', credentials=None): |
| 20 super(Top25Page, self).__init__( | 20 super(Top25Page, self).__init__( |
| 21 url=url, page_set=page_set, name=name, | 21 url=url, page_set=page_set, name=name, |
| 22 credentials_path='data/credentials.json') | 22 credentials_path='data/credentials.json') |
| 23 self.user_agent_type = 'desktop' | 23 self.user_agent_type = 'desktop' |
| 24 self.archive_data_file = 'data/top_25.json' | 24 self.archive_data_file = 'data/top_25.json' |
| 25 self.credentials = credentials |
| 25 | 26 |
| 26 def RunSmoothness(self, action_runner): | 27 def RunSmoothness(self, action_runner): |
| 27 interaction = action_runner.BeginGestureInteraction( | 28 interaction = action_runner.BeginGestureInteraction( |
| 28 'ScrollAction', is_smooth=True) | 29 'ScrollAction', is_smooth=True) |
| 29 action_runner.ScrollPage() | 30 action_runner.ScrollPage() |
| 30 interaction.End() | 31 interaction.End() |
| 31 | 32 |
| 32 def RunRepaint(self, action_runner): | 33 def RunRepaint(self, action_runner): |
| 33 action_runner.RepaintContinuously(seconds=5) | 34 action_runner.RepaintContinuously(seconds=5) |
| 34 | 35 |
| 35 | 36 |
| 36 class GoogleWebSearchPage(Top25Page): | 37 class GoogleWebSearchPage(Top25Page): |
| 37 | 38 |
| 38 """ Why: top google property; a google tab is often open """ | 39 """ Why: top google property; a google tab is often open """ |
| 39 | 40 |
| 40 def __init__(self, page_set): | 41 def __init__(self, page_set): |
| 41 super(GoogleWebSearchPage, self).__init__( | 42 super(GoogleWebSearchPage, self).__init__( |
| 42 url='https://www.google.com/#hl=en&q=barack+obama', | 43 url='https://www.google.com/#hl=en&q=barack+obama', |
| 43 page_set=page_set) | 44 page_set=page_set) |
| 44 | 45 |
| 45 def RunNavigateSteps(self, action_runner): | 46 def RunNavigateSteps(self, action_runner): |
| 46 action_runner.NavigateToPage(self) | 47 action_runner.NavigateToPage(self) |
| 47 action_runner.WaitForElement(text='Next') | 48 action_runner.WaitForElement(text='Next') |
| 48 | 49 |
| 49 | 50 |
| 50 class GmailPage(Top25Page): | 51 class GmailPage(Top25Page): |
| 51 | 52 |
| 52 """ Why: productivity, top google properties """ | 53 """ Why: productivity, top google properties """ |
| 53 | 54 |
| 54 def __init__(self, page_set): | 55 def __init__(self, page_set): |
| 55 super(GmailPage, self).__init__( | 56 super(GmailPage, self).__init__( |
| 56 url='https://mail.google.com/mail/', | 57 url='https://mail.google.com/mail/', |
| 57 page_set=page_set) | 58 page_set=page_set, |
| 58 | 59 credentials='google') |
| 59 self.credentials = 'google' | |
| 60 | 60 |
| 61 def RunNavigateSteps(self, action_runner): | 61 def RunNavigateSteps(self, action_runner): |
| 62 action_runner.NavigateToPage(self) | 62 action_runner.NavigateToPage(self) |
| 63 action_runner.WaitForJavaScriptCondition( | 63 action_runner.WaitForJavaScriptCondition( |
| 64 'window.gmonkey !== undefined &&' | 64 'window.gmonkey !== undefined &&' |
| 65 'document.getElementById("gb") !== null') | 65 'document.getElementById("gb") !== null') |
| 66 | 66 |
| 67 def RunSmoothness(self, action_runner): | 67 def RunSmoothness(self, action_runner): |
| 68 action_runner.ExecuteJavaScript(''' | 68 action_runner.ExecuteJavaScript(''' |
| 69 gmonkey.load('2.0', function(api) { | 69 gmonkey.load('2.0', function(api) { |
| 70 window.__scrollableElementForTelemetry = api.getScrollableElement(); | 70 window.__scrollableElementForTelemetry = api.getScrollableElement(); |
| 71 });''') | 71 });''') |
| 72 action_runner.WaitForJavaScriptCondition( | 72 action_runner.WaitForJavaScriptCondition( |
| 73 'window.__scrollableElementForTelemetry != null') | 73 'window.__scrollableElementForTelemetry != null') |
| 74 interaction = action_runner.BeginGestureInteraction( | 74 interaction = action_runner.BeginGestureInteraction( |
| 75 'ScrollAction', is_smooth=True) | 75 'ScrollAction', is_smooth=True) |
| 76 action_runner.ScrollElement( | 76 action_runner.ScrollElement( |
| 77 element_function='window.__scrollableElementForTelemetry') | 77 element_function='window.__scrollableElementForTelemetry') |
| 78 interaction.End() | 78 interaction.End() |
| 79 | 79 |
| 80 | 80 |
| 81 class GoogleCalendarPage(Top25Page): | 81 class GoogleCalendarPage(Top25Page): |
| 82 | 82 |
| 83 """ Why: productivity, top google properties """ | 83 """ Why: productivity, top google properties """ |
| 84 | 84 |
| 85 def __init__(self, page_set): | 85 def __init__(self, page_set): |
| 86 super(GoogleCalendarPage, self).__init__( | 86 super(GoogleCalendarPage, self).__init__( |
| 87 url='https://www.google.com/calendar/', | 87 url='https://www.google.com/calendar/', |
| 88 page_set=page_set) | 88 page_set=page_set, |
| 89 | 89 credentials='google') |
| 90 self.credentials = 'google' | |
| 91 | 90 |
| 92 def RunNavigateSteps(self, action_runner): | 91 def RunNavigateSteps(self, action_runner): |
| 93 action_runner.NavigateToPage(self) | 92 action_runner.NavigateToPage(self) |
| 94 action_runner.Wait(2) | 93 action_runner.Wait(2) |
| 95 action_runner.WaitForElement('div[class~="navForward"]') | 94 action_runner.WaitForElement('div[class~="navForward"]') |
| 96 action_runner.ExecuteJavaScript(''' | 95 action_runner.ExecuteJavaScript(''' |
| 97 (function() { | 96 (function() { |
| 98 var elem = document.createElement('meta'); | 97 var elem = document.createElement('meta'); |
| 99 elem.name='viewport'; | 98 elem.name='viewport'; |
| 100 elem.content='initial-scale=1'; | 99 elem.content='initial-scale=1'; |
| 101 document.body.appendChild(elem); | 100 document.body.appendChild(elem); |
| 102 })();''') | 101 })();''') |
| 103 action_runner.Wait(1) | 102 action_runner.Wait(1) |
| 104 | 103 |
| 105 def RunSmoothness(self, action_runner): | 104 def RunSmoothness(self, action_runner): |
| 106 interaction = action_runner.BeginGestureInteraction( | 105 interaction = action_runner.BeginGestureInteraction( |
| 107 'ScrollAction', is_smooth=True) | 106 'ScrollAction', is_smooth=True) |
| 108 action_runner.ScrollElement(selector='#scrolltimedeventswk') | 107 action_runner.ScrollElement(selector='#scrolltimedeventswk') |
| 109 interaction.End() | 108 interaction.End() |
| 110 | 109 |
| 111 | 110 |
| 112 class GoogleImageSearchPage(Top25Page): | |
| 113 | |
| 114 """ Why: tough image case; top google properties """ | |
| 115 | |
| 116 def __init__(self, page_set): | |
| 117 super(GoogleImageSearchPage, self).__init__( | |
| 118 url='https://www.google.com/search?q=cats&tbm=isch', | |
| 119 page_set=page_set) | |
| 120 | |
| 121 self.credentials = 'google' | |
| 122 | |
| 123 | |
| 124 class GoogleDocPage(Top25Page): | 111 class GoogleDocPage(Top25Page): |
| 125 | 112 |
| 126 """ Why: productivity, top google properties; Sample doc in the link """ | 113 """ Why: productivity, top google properties; Sample doc in the link """ |
| 127 | 114 |
| 128 def __init__(self, page_set): | 115 def __init__(self, page_set): |
| 129 super(GoogleDocPage, self).__init__( | 116 super(GoogleDocPage, self).__init__( |
| 130 # pylint: disable=C0301 | 117 # pylint: disable=C0301 |
| 131 url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3mfT
pAPUSX3_s4/view', | 118 url='https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3m
fTpAPUSX3_s4/view', |
| 132 page_set=page_set, | 119 page_set=page_set, |
| 133 name='Docs (1 open document tab)') | 120 name='Docs (1 open document tab)', |
| 134 | 121 credentials='google') |
| 135 self.credentials = 'google' | |
| 136 | 122 |
| 137 def RunNavigateSteps(self, action_runner): | 123 def RunNavigateSteps(self, action_runner): |
| 138 action_runner.NavigateToPage(self) | 124 action_runner.NavigateToPage(self) |
| 139 action_runner.Wait(2) | 125 action_runner.Wait(2) |
| 140 action_runner.WaitForJavaScriptCondition( | 126 action_runner.WaitForJavaScriptCondition( |
| 141 'document.getElementsByClassName("kix-appview-editor").length') | 127 'document.getElementsByClassName("kix-appview-editor").length') |
| 142 | 128 |
| 143 def RunSmoothness(self, action_runner): | 129 def RunSmoothness(self, action_runner): |
| 144 interaction = action_runner.BeginGestureInteraction( | 130 interaction = action_runner.BeginGestureInteraction( |
| 145 'ScrollAction', is_smooth=True) | 131 'ScrollAction', is_smooth=True) |
| 146 action_runner.ScrollElement(selector='.kix-appview-editor') | 132 action_runner.ScrollElement(selector='.kix-appview-editor') |
| 147 interaction.End() | 133 interaction.End() |
| 148 | 134 |
| 149 | 135 |
| 150 class GooglePlusPage(Top25Page): | 136 class GooglePlusPage(Top25Page): |
| 151 | 137 |
| 152 """ Why: social; top google property; Public profile; infinite scrolls """ | 138 """ Why: social; top google property; Public profile; infinite scrolls """ |
| 153 | 139 |
| 154 def __init__(self, page_set): | 140 def __init__(self, page_set): |
| 155 super(GooglePlusPage, self).__init__( | 141 super(GooglePlusPage, self).__init__( |
| 156 url='https://plus.google.com/110031535020051778989/posts', | 142 url='https://plus.google.com/110031535020051778989/posts', |
| 157 page_set=page_set) | 143 page_set=page_set, |
| 158 | 144 credentials='google') |
| 159 self.credentials = 'google' | |
| 160 | 145 |
| 161 def RunNavigateSteps(self, action_runner): | 146 def RunNavigateSteps(self, action_runner): |
| 162 action_runner.NavigateToPage(self) | 147 action_runner.NavigateToPage(self) |
| 163 action_runner.WaitForElement(text='Home') | 148 action_runner.WaitForElement(text='Home') |
| 164 | 149 |
| 165 def RunSmoothness(self, action_runner): | 150 def RunSmoothness(self, action_runner): |
| 166 interaction = action_runner.BeginGestureInteraction( | 151 interaction = action_runner.BeginGestureInteraction( |
| 167 'ScrollAction', is_smooth=True) | 152 'ScrollAction', is_smooth=True) |
| 168 action_runner.ScrollPage() | 153 action_runner.ScrollPage() |
| 169 interaction.End() | 154 interaction.End() |
| 170 | 155 |
| 171 | 156 |
| 172 class YoutubePage(Top25Page): | 157 class YoutubePage(Top25Page): |
| 173 | 158 |
| 174 """ Why: #3 (Alexa global) """ | 159 """ Why: #3 (Alexa global) """ |
| 175 | 160 |
| 176 def __init__(self, page_set): | 161 def __init__(self, page_set): |
| 177 super(YoutubePage, self).__init__( | 162 super(YoutubePage, self).__init__( |
| 178 url='http://www.youtube.com', | 163 url='http://www.youtube.com', |
| 179 page_set=page_set) | 164 page_set=page_set, credentials='google') |
| 180 | |
| 181 self.credentials = 'google' | |
| 182 | 165 |
| 183 def RunNavigateSteps(self, action_runner): | 166 def RunNavigateSteps(self, action_runner): |
| 184 action_runner.NavigateToPage(self) | 167 action_runner.NavigateToPage(self) |
| 185 action_runner.Wait(2) | 168 action_runner.Wait(2) |
| 186 | 169 |
| 187 | 170 |
| 188 class BlogspotPage(Top25Page): | 171 class BlogspotPage(Top25Page): |
| 189 | 172 |
| 190 """ Why: #11 (Alexa global), google property; some blogger layouts have | 173 """ Why: #11 (Alexa global), google property; some blogger layouts have |
| 191 infinite scroll but more interesting """ | 174 infinite scroll but more interesting """ |
| 192 | 175 |
| 193 def __init__(self, page_set): | 176 def __init__(self, page_set): |
| 194 super(BlogspotPage, self).__init__( | 177 super(BlogspotPage, self).__init__( |
| 195 url='http://googlewebmastercentral.blogspot.com/', | 178 url='http://googlewebmastercentral.blogspot.com/', |
| 196 page_set=page_set, | 179 page_set=page_set, |
| 197 name='Blogger') | 180 name='Blogger') |
| 198 | 181 |
| 199 def RunNavigateSteps(self, action_runner): | 182 def RunNavigateSteps(self, action_runner): |
| 200 action_runner.NavigateToPage(self) | 183 action_runner.NavigateToPage(self) |
| 201 action_runner.WaitForElement(text='accessibility') | 184 action_runner.WaitForElement(text='accessibility') |
| 202 | 185 |
| 203 | 186 |
| 204 class WordpressPage(Top25Page): | 187 class WordpressPage(Top25Page): |
| 205 | 188 |
| 206 """ Why: #18 (Alexa global), Picked an interesting post """ | 189 """ Why: #18 (Alexa global), Picked an interesting post """ |
| 207 | 190 |
| 208 def __init__(self, page_set): | 191 def __init__(self, page_set): |
| 209 super(WordpressPage, self).__init__( | 192 super(WordpressPage, self).__init__( |
| 210 # pylint: disable=C0301 | 193 # pylint: disable=C0301 |
| 211 url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks
-for-august-2012/', | 194 url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-pic
ks-for-august-2012/', |
| 212 page_set=page_set, | 195 page_set=page_set, |
| 213 name='Wordpress') | 196 name='Wordpress') |
| 214 | 197 |
| 215 def RunNavigateSteps(self, action_runner): | 198 def RunNavigateSteps(self, action_runner): |
| 216 action_runner.NavigateToPage(self) | 199 action_runner.NavigateToPage(self) |
| 217 action_runner.WaitForElement( | 200 action_runner.WaitForElement( |
| 218 # pylint: disable=C0301 | 201 # pylint: disable=C0301 |
| 219 'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sig
ht/"]') | 202 'a[href="http://en.blog.wordpress.com/2012/08/30/new-themes-able-and-sig
ht/"]') |
| 220 | 203 |
| 204 |
| 221 class FacebookPage(Top25Page): | 205 class FacebookPage(Top25Page): |
| 222 | 206 |
| 223 """ Why: top social,Public profile """ | 207 """ Why: top social,Public profile """ |
| 224 | 208 |
| 225 def __init__(self, page_set): | 209 def __init__(self, page_set): |
| 226 super(FacebookPage, self).__init__( | 210 super(FacebookPage, self).__init__( |
| 227 url='http://www.facebook.com/barackobama', | 211 url='http://www.facebook.com/barackobama', |
| 228 page_set=page_set, | 212 page_set=page_set, |
| 229 name='Facebook') | 213 name='Facebook', credentials='facebook') |
| 230 self.credentials = 'facebook' | |
| 231 | 214 |
| 232 def RunNavigateSteps(self, action_runner): | 215 def RunNavigateSteps(self, action_runner): |
| 233 action_runner.NavigateToPage(self) | 216 action_runner.NavigateToPage(self) |
| 234 action_runner.WaitForElement(text='About') | 217 action_runner.WaitForElement(text='About') |
| 235 | 218 |
| 236 def RunSmoothness(self, action_runner): | 219 def RunSmoothness(self, action_runner): |
| 237 interaction = action_runner.BeginGestureInteraction( | 220 interaction = action_runner.BeginGestureInteraction( |
| 238 'ScrollAction', is_smooth=True) | 221 'ScrollAction', is_smooth=True) |
| 239 action_runner.ScrollPage() | 222 action_runner.ScrollPage() |
| 240 interaction.End() | 223 interaction.End() |
| 241 | 224 |
| 242 | 225 |
| 243 class LinkedinPage(Top25Page): | |
| 244 | |
| 245 """ Why: #12 (Alexa global),Public profile """ | |
| 246 | |
| 247 def __init__(self, page_set): | |
| 248 super(LinkedinPage, self).__init__( | |
| 249 url='http://www.linkedin.com/in/linustorvalds', | |
| 250 page_set=page_set, | |
| 251 name='LinkedIn') | |
| 252 | |
| 253 | |
| 254 class WikipediaPage(Top25Page): | |
| 255 | |
| 256 """ Why: #6 (Alexa) most visited worldwide,Picked an interesting page """ | |
| 257 | |
| 258 def __init__(self, page_set): | |
| 259 super(WikipediaPage, self).__init__( | |
| 260 url='http://en.wikipedia.org/wiki/Wikipedia', | |
| 261 page_set=page_set, | |
| 262 name='Wikipedia (1 tab)') | |
| 263 | |
| 264 | |
| 265 class TwitterPage(Top25Page): | 226 class TwitterPage(Top25Page): |
| 266 | 227 |
| 267 """ Why: #8 (Alexa global),Picked an interesting page """ | 228 """ Why: #8 (Alexa global),Picked an interesting page """ |
| 268 | 229 |
| 269 def __init__(self, page_set): | 230 def __init__(self, page_set): |
| 270 super(TwitterPage, self).__init__( | 231 super(TwitterPage, self).__init__( |
| 271 url='https://twitter.com/katyperry', | 232 url='https://twitter.com/katyperry', |
| 272 page_set=page_set, | 233 page_set=page_set, |
| 273 name='Twitter') | 234 name='Twitter') |
| 274 | 235 |
| 275 def RunNavigateSteps(self, action_runner): | 236 def RunNavigateSteps(self, action_runner): |
| 276 action_runner.NavigateToPage(self) | 237 action_runner.NavigateToPage(self) |
| 277 action_runner.Wait(2) | 238 action_runner.Wait(2) |
| 278 | 239 |
| 279 def RunSmoothness(self, action_runner): | 240 def RunSmoothness(self, action_runner): |
| 280 interaction = action_runner.BeginGestureInteraction( | 241 interaction = action_runner.BeginGestureInteraction( |
| 281 'ScrollAction', is_smooth=True) | 242 'ScrollAction', is_smooth=True) |
| 282 action_runner.ScrollPage() | 243 action_runner.ScrollPage() |
| 283 interaction.End() | 244 interaction.End() |
| 284 | 245 |
| 285 | 246 |
| 286 class PinterestPage(Top25Page): | 247 class PinterestPage(Top25Page): |
| 287 | 248 |
| 288 """ Why: #37 (Alexa global) """ | 249 """ Why: #37 (Alexa global) """ |
| 289 | 250 |
| 290 def __init__(self, page_set): | 251 def __init__(self, page_set): |
| 291 super(PinterestPage, self).__init__( | 252 super(PinterestPage, self).__init__( |
| 292 url='http://pinterest.com', | 253 url='http://pinterest.com', |
| 293 page_set=page_set, | 254 page_set=page_set, |
| 294 name='Pinterest') | 255 name='Pinterest') |
| 295 | 256 |
| 296 def RunSmoothness(self, action_runner): | 257 def RunSmoothness(self, action_runner): |
| 297 interaction = action_runner.BeginGestureInteraction( | 258 interaction = action_runner.BeginGestureInteraction( |
| 298 'ScrollAction', is_smooth=True) | 259 'ScrollAction', is_smooth=True) |
| 299 action_runner.ScrollPage() | 260 action_runner.ScrollPage() |
| 300 interaction.End() | 261 interaction.End() |
| 301 | 262 |
| 302 | 263 |
| 303 class ESPNPage(Top25Page): | 264 class ESPNPage(Top25Page): |
| 304 | 265 |
| 305 """ Why: #1 sports """ | 266 """ Why: #1 sports """ |
| 306 | 267 |
| 307 def __init__(self, page_set): | 268 def __init__(self, page_set): |
| 308 super(ESPNPage, self).__init__( | 269 super(ESPNPage, self).__init__( |
| 309 url='http://espn.go.com', | 270 url='http://espn.go.com', |
| 310 page_set=page_set, | 271 page_set=page_set, |
| 311 name='ESPN') | 272 name='ESPN') |
| 312 | 273 |
| 313 def RunSmoothness(self, action_runner): | 274 def RunSmoothness(self, action_runner): |
| 314 interaction = action_runner.BeginGestureInteraction( | 275 interaction = action_runner.BeginGestureInteraction( |
| 315 'ScrollAction', is_smooth=True) | 276 'ScrollAction', is_smooth=True) |
| 316 action_runner.ScrollPage(left_start_ratio=0.1) | 277 action_runner.ScrollPage(left_start_ratio=0.1) |
| 317 interaction.End() | 278 interaction.End() |
| 318 | 279 |
| 319 | 280 |
| 320 class WeatherDotComPage(Top25Page): | |
| 321 | |
| 322 """ Why: #7 (Alexa news); #27 total time spent,Picked interesting page """ | |
| 323 | |
| 324 def __init__(self, page_set): | |
| 325 super(WeatherDotComPage, self).__init__( | |
| 326 # pylint: disable=C0301 | |
| 327 url='http://www.weather.com/weather/right-now/Mountain+View+CA+94043', | |
| 328 page_set=page_set, | |
| 329 name='Weather.com') | |
| 330 | |
| 331 | |
| 332 class YahooGamesPage(Top25Page): | 281 class YahooGamesPage(Top25Page): |
| 333 | 282 |
| 334 """ Why: #1 games according to Alexa (with actual games in it) """ | 283 """ Why: #1 games according to Alexa (with actual games in it) """ |
| 335 | 284 |
| 336 def __init__(self, page_set): | 285 def __init__(self, page_set): |
| 337 super(YahooGamesPage, self).__init__( | 286 super(YahooGamesPage, self).__init__( |
| 338 url='http://games.yahoo.com', | 287 url='http://games.yahoo.com', |
| 339 page_set=page_set) | 288 page_set=page_set) |
| 340 | 289 |
| 341 def RunNavigateSteps(self, action_runner): | 290 def RunNavigateSteps(self, action_runner): |
| 342 action_runner.NavigateToPage(self) | 291 action_runner.NavigateToPage(self) |
| 343 action_runner.Wait(2) | 292 action_runner.Wait(2) |
| 344 | 293 |
| 345 | 294 |
| 346 class Top25PageSet(page_set_module.PageSet): | 295 class Top25PageSet(page_set_module.PageSet): |
| 347 | 296 |
| 348 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ | 297 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ |
| 349 | 298 |
| 350 def __init__(self): | 299 def __init__(self): |
| 351 super(Top25PageSet, self).__init__( | 300 super(Top25PageSet, self).__init__( |
| 352 user_agent_type='desktop', | 301 user_agent_type='desktop', |
| 353 archive_data_file='data/top_25.json', | 302 archive_data_file='data/top_25.json', |
| 354 bucket=page_set_module.PARTNER_BUCKET) | 303 bucket=page_set_module.PARTNER_BUCKET) |
| 355 | 304 |
| 356 self.AddPage(GoogleWebSearchPage(self)) | 305 self.AddPage(GoogleWebSearchPage(self)) |
| 357 self.AddPage(GmailPage(self)) | 306 self.AddPage(GmailPage(self)) |
| 358 self.AddPage(GoogleCalendarPage(self)) | 307 self.AddPage(GoogleCalendarPage(self)) |
| 359 self.AddPage(GoogleImageSearchPage(self)) | 308 # Why: tough image case; top google properties |
| 309 self.AddPage( |
| 310 Top25Page('https://www.google.com/search?q=cats&tbm=isch', |
| 311 page_set=self, credentials='google')) |
| 360 self.AddPage(GoogleDocPage(self)) | 312 self.AddPage(GoogleDocPage(self)) |
| 361 self.AddPage(GooglePlusPage(self)) | 313 self.AddPage(GooglePlusPage(self)) |
| 362 self.AddPage(YoutubePage(self)) | 314 self.AddPage(YoutubePage(self)) |
| 363 self.AddPage(BlogspotPage(self)) | 315 self.AddPage(BlogspotPage(self)) |
| 364 self.AddPage(WordpressPage(self)) | 316 self.AddPage(WordpressPage(self)) |
| 365 self.AddPage(FacebookPage(self)) | 317 self.AddPage(FacebookPage(self)) |
| 366 self.AddPage(LinkedinPage(self)) | 318 # Why: #12 (Alexa global), Public profile. |
| 367 self.AddPage(WikipediaPage(self)) | 319 self.AddPage( |
| 320 Top25Page( |
| 321 'http://www.linkedin.com/in/linustorvalds', page_set=self, |
| 322 name='LinkedIn')) |
| 323 # Why: #6 (Alexa) most visited worldwide,Picked an interesting page |
| 324 self.AddPage( |
| 325 Top25Page( |
| 326 'http://en.wikipedia.org/wiki/Wikipedia', page_set=self, |
| 327 name='Wikipedia (1 tab)')) |
| 368 self.AddPage(TwitterPage(self)) | 328 self.AddPage(TwitterPage(self)) |
| 369 self.AddPage(PinterestPage(self)) | 329 self.AddPage(PinterestPage(self)) |
| 370 self.AddPage(ESPNPage(self)) | 330 self.AddPage(ESPNPage(self)) |
| 371 self.AddPage(WeatherDotComPage(self)) | 331 # Why: #7 (Alexa news); #27 total time spent, picked interesting page. |
| 332 self.AddPage(Top25Page( |
| 333 url='http://www.weather.com/weather/right-now/Mountain+View+CA+94043', |
| 334 page_set=self, |
| 335 name='Weather.com')) |
| 372 self.AddPage(YahooGamesPage(self)) | 336 self.AddPage(YahooGamesPage(self)) |
| 373 | 337 |
| 374 other_urls = [ | 338 other_urls = [ |
| 375 # Why: #1 news worldwide (Alexa global) | 339 # Why: #1 news worldwide (Alexa global) |
| 376 'http://news.yahoo.com', | 340 'http://news.yahoo.com', |
| 377 # Why: #2 news worldwide | 341 # Why: #2 news worldwide |
| 378 'http://www.cnn.com', | 342 'http://www.cnn.com', |
| 379 # Why: #1 world commerce website by visits; #3 commerce in the US by time | 343 # Why: #1 world commerce website by visits; #3 commerce in the US by |
| 380 # spent | 344 # time spent |
| 381 'http://www.amazon.com', | 345 'http://www.amazon.com', |
| 382 # Why: #1 commerce website by time spent by users in US | 346 # Why: #1 commerce website by time spent by users in US |
| 383 'http://www.ebay.com', | 347 'http://www.ebay.com', |
| 384 # Why: #1 Alexa recreation | 348 # Why: #1 Alexa recreation |
| 385 'http://booking.com', | 349 'http://booking.com', |
| 386 # Why: #1 Alexa reference | 350 # Why: #1 Alexa reference |
| 387 'http://answers.yahoo.com', | 351 'http://answers.yahoo.com', |
| 388 # Why: #1 Alexa sports | 352 # Why: #1 Alexa sports |
| 389 'http://sports.yahoo.com/', | 353 'http://sports.yahoo.com/', |
| 390 # Why: top tech blog | 354 # Why: top tech blog |
| 391 'http://techcrunch.com' | 355 'http://techcrunch.com' |
| 392 ] | 356 ] |
| 393 | 357 |
| 394 for url in other_urls: | 358 for url in other_urls: |
| 395 self.AddPage(Top25Page(url, self)) | 359 self.AddPage(Top25Page(url, self)) |
| OLD | NEW |