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 shared_page_state
6 from telemetry
import story
9 class KeySearchMobilePage(page_module
.Page
):
11 def __init__(self
, url
, page_set
):
12 super(KeySearchMobilePage
, self
).__init
__(
13 url
=url
, page_set
=page_set
, credentials_path
= 'data/credentials.json',
14 shared_page_state_class
=shared_page_state
.SharedMobilePageState
)
15 self
.archive_data_file
= 'data/key_search_mobile.json'
17 def RunPageInteractions(self
, action_runner
):
18 with action_runner
.CreateGestureInteraction('ScrollAction'):
19 action_runner
.ScrollPage()
22 class KeySearchMobilePageSet(story
.StorySet
):
24 """ Key mobile search queries on google """
27 super(KeySearchMobilePageSet
, self
).__init
__(
28 archive_data_file
='data/key_search_mobile.json',
29 cloud_storage_bucket
=story
.PUBLIC_BUCKET
)
32 # Why: An empty page should be as snappy as possible
33 'http://www.google.com/',
34 # Why: A reasonable search term with no images or ads usually
35 'https://www.google.com/search?q=science',
36 # Why: A reasonable search term with images but no ads usually
37 'http://www.google.com/search?q=orange',
38 # Why: An address search
39 # pylint: disable=C0301
40 'https://www.google.com/search?q=1600+Amphitheatre+Pkwy%2C+Mountain+View%2C+CA',
41 # Why: A search for a known actor
42 'http://www.google.com/search?q=tom+hanks',
43 # Why: A search for weather
44 'https://www.google.com/search?q=weather+94110',
45 # Why: A search for a stock
46 'http://www.google.com/search?q=goog',
48 'https://www.google.com/search?q=population+of+california',
50 'http://www.google.com/search?q=sfo+jfk+flights',
51 # Why: Movie showtimes
52 'https://www.google.com/search?q=movies+94110',
53 # Why: A tip calculator
54 'http://www.google.com/search?q=tip+on+100+bill',
56 'https://www.google.com/search?q=time+in+san+francisco',
58 'http://www.google.com/search?q=define+define',
60 'https://www.google.com/search?q=burritos+94110',
62 'http://www.google.com/search?q=x^3'
66 self
.AddStory(KeySearchMobilePage(url
, self
))