Chromium Code Reviews| Index: tools/perf/page_sets/system_health/browsing_stories.py |
| diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py |
| index 50d777900bd9254f94a241ebb7268928535b9bef..13a60dce96b8cda1d765b38b2db1335055405035 100644 |
| --- a/tools/perf/page_sets/system_health/browsing_stories.py |
| +++ b/tools/perf/page_sets/system_health/browsing_stories.py |
| @@ -1,3 +1,4 @@ |
| +# encoding: utf-8 |
| # Copyright 2016 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| @@ -8,6 +9,7 @@ from page_sets.system_health import system_health_story |
| from page_sets.login_helpers import pinterest_login |
| from telemetry import decorators |
| +from telemetry.util import js_template |
| class _BrowsingStory(system_health_story.SystemHealthStory): |
| @@ -289,6 +291,49 @@ class GoogleDesktopStory(_NewsBrowsingStory): |
| action_runner.ScrollPage() |
| +class GoogleIndiaDesktopStory(_NewsBrowsingStory): |
| + """ |
| + A typical google search story in India: |
| + _ Start at https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2` |
|
rnephew (Reviews Here)
2017/01/03 17:03:11
Any reason these are underscores? Just want to mak
nednguyen
2017/01/03 17:19:24
Oops, no reason at all. It's me being silly. :P
D
|
| + _ Scroll down the page. |
| + _ Refine the query & click search box, which navigates to |
| + https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2&rct=j#q=%E0%A4%AB%E0%A5%82%E0%A4%B2+%E0%A4%B5%E0%A4%BF%E0%A4%A4%E0%A4%B0%E0%A4%A3 |
| + _ Scroll down the page. |
| + _ Click the next page result |
| + _ Scroll the search page. |
| + |
| + """ |
| + NAME = 'browse:search:google_india' |
| + URL = 'https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2' |
| + _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]' |
| + _SEARCH_BUTTON_SELECTOR = 'button[aria-label="Google Search"]' |
| + _SEARCH_PAGE_2_SELECTOR = 'a[aria-label=\'Page 2\']' |
| + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| + |
| + def _DidLoadDocument(self, action_runner): |
| + action_runner.Wait(2) |
| + action_runner.ScrollPage() |
| + action_runner.Wait(2) |
| + |
| + action_runner.ScrollPage(direction='up') |
| + |
| + # Refine search query in the search box. |
| + action_runner.ExecuteJavaScript( |
|
rnephew (Reviews Here)
2017/01/03 17:03:11
I assume this is entering text into the search tex
nednguyen
2017/01/03 17:19:24
Correct. This text not being English makes it impo
|
| + js_template.Render( |
| + 'document.querySelector({{ selector }}).value += "वितरण";', |
| + selector=self._SEARCH_BOX_SELECTOR)) |
| + action_runner.Wait(2) |
| + action_runner.ClickElement(selector=self._SEARCH_BUTTON_SELECTOR) |
| + |
| + # Scroll down & click next search result page. |
| + action_runner.Wait(2) |
| + action_runner.ScrollPageToElement(selector=self._SEARCH_PAGE_2_SELECTOR) |
| + action_runner.Wait(2) |
| + action_runner.ClickElement(selector=self._SEARCH_PAGE_2_SELECTOR) |
| + action_runner.Wait(2) |
| + action_runner.ScrollPage() |
| + |
| + |
| ############################################################################## |
| # Media browsing stories. |
| ############################################################################## |