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 3 # found in the LICENSE file. 4 # pylint: disable=W0401,W0614 5 from telemetry.page.actions.all_page_actions import * 6 from telemetry.page import page as page_module 7 from telemetry.page import page_set as page_set_module 8 9 10 class KeySearchMobilePage(page_module.Page): 11 12 def __init__(self, url, page_set): 13 super(KeySearchMobilePage, self).__init__(url=url, page_set=page_set) 14 self.credentials_path = 'data/credentials.json' 15 self.user_agent_type = 'mobile' 16 self.archive_data_file = 'data/key_search_mobile.json' 17 18 def RunSmoothness(self, action_runner): 19 action_runner.RunAction(ScrollAction()) 20 21 22 class KeySearchMobilePageSet(page_set_module.PageSet): 23 24 """ Key mobile search queries on google """ 25 26 def __init__(self): 27 super(KeySearchMobilePageSet, self).__init__( 28 credentials_path='data/credentials.json', 29 user_agent_type='mobile', 30 archive_data_file='data/key_search_mobile.json', 31 bucket=page_set_module.PUBLIC_BUCKET) 32 33 urls_list = [ 34 # Why: An empty page should be as snappy as possible 35 'http://www.google.com/', 36 # Why: A reasonable search term with no images or ads usually 37 'https://www.google.com/search?q=science', 38 # Why: A reasonable search term with images but no ads usually 39 'http://www.google.com/search?q=orange', 40 # Why: An address search 41 # pylint: disable=C0301 42 'https://www.google.com/search?q=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA', 43 # Why: A search for a known actor 44 'http://www.google.com/search?q=tom+hanks', 45 # Why: A search for weather 46 'https://www.google.com/search?q=weather+94110', 47 # Why: A search for a stock 48 'http://www.google.com/search?q=goog', 49 # Why: Charts 50 'https://www.google.com/search?q=population+of+california', 51 # Why: Flights 52 'http://www.google.com/search?q=sfo+jfk+flights', 53 # Why: Movie showtimes 54 'https://www.google.com/search?q=movies+94110', 55 # Why: A tip calculator 56 'http://www.google.com/search?q=tip+on+100+bill', 57 # Why: Time 58 'https://www.google.com/search?q=time+in+san+francisco', 59 # Why: Definitions 60 'http://www.google.com/search?q=define+define', 61 # Why: Local results 62 'https://www.google.com/search?q=burritos+94110', 63 # Why: Graph 64 'http://www.google.com/search?q=x^3' 65 ] 66 67 for url in urls_list: 68 self.AddPage(KeySearchMobilePage(url, self)) 69