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 from telemetry
.page
import page
as page_module
5 from telemetry
.page
import page_set
as page_set_module
8 class KeySearchMobilePage(page_module
.Page
):
10 def __init__(self
, url
, page_set
):
11 super(KeySearchMobilePage
, self
).__init
__(url
=url
, page_set
=page_set
)
12 self
.credentials_path
= 'data/credentials.json'
13 self
.user_agent_type
= 'mobile'
14 self
.archive_data_file
= 'data/key_search_mobile.json'
16 def RunSmoothness(self
, action_runner
):
17 interaction
= action_runner
.BeginGestureInteraction(
18 'ScrollAction', is_smooth
=True)
19 action_runner
.ScrollPage()
23 class KeySearchMobilePageSet(page_set_module
.PageSet
):
25 """ Key mobile search queries on google """
28 super(KeySearchMobilePageSet
, self
).__init
__(
29 credentials_path
='data/credentials.json',
30 user_agent_type
='mobile',
31 archive_data_file
='data/key_search_mobile.json',
32 bucket
=page_set_module
.PUBLIC_BUCKET
)
35 # Why: An empty page should be as snappy as possible
36 'http://www.google.com/',
37 # Why: A reasonable search term with no images or ads usually
38 'https://www.google.com/search?q=science',
39 # Why: A reasonable search term with images but no ads usually
40 'http://www.google.com/search?q=orange',
41 # Why: An address search
42 # pylint: disable=C0301
43 'https://www.google.com/search?q=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA',
44 # Why: A search for a known actor
45 'http://www.google.com/search?q=tom+hanks',
46 # Why: A search for weather
47 'https://www.google.com/search?q=weather+94110',
48 # Why: A search for a stock
49 'http://www.google.com/search?q=goog',
51 'https://www.google.com/search?q=population+of+california',
53 'http://www.google.com/search?q=sfo+jfk+flights',
54 # Why: Movie showtimes
55 'https://www.google.com/search?q=movies+94110',
56 # Why: A tip calculator
57 'http://www.google.com/search?q=tip+on+100+bill',
59 'https://www.google.com/search?q=time+in+san+francisco',
61 'http://www.google.com/search?q=define+define',
63 'https://www.google.com/search?q=burritos+94110',
65 'http://www.google.com/search?q=x^3'
69 self
.AddPage(KeySearchMobilePage(url
, self
))