Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: tools/chrome_remote_control/chrome_remote_control/click_to_navigate_interaction.py

Issue 11369075: Chrome remote control multipage tests: Add interactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: code review & tests Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/chrome_remote_control/chrome_remote_control/click_to_navigate_interaction.py
diff --git a/build/android/pylib/run_tests_helper.py b/tools/chrome_remote_control/chrome_remote_control/click_to_navigate_interaction.py
similarity index 20%
copy from build/android/pylib/run_tests_helper.py
copy to tools/chrome_remote_control/chrome_remote_control/click_to_navigate_interaction.py
index 15e5d5381bcc9b6d9a3e97dcbed40191556a9904..7a7312bffbf51a9065c84ed2ef53be9340a49586 100644
--- a/build/android/pylib/run_tests_helper.py
+++ b/tools/chrome_remote_control/chrome_remote_control/click_to_navigate_interaction.py
@@ -1,26 +1,24 @@
# Copyright (c) 2012 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.
+from chrome_remote_control import page_interaction
-"""Helper functions common to native, java and python test runners."""
+class ClickToNavigateInteraction(page_interaction.PageInteraction):
+ def __init__(self, data):
nduca 2012/11/07 18:55:57 what is data here? Is it the page object? Or some
marja 2012/11/08 10:24:00 I changed this to follow the same pattern as page.
+ super(ClickToNavigateInteraction, self).__init__()
+ self._data = data
-import logging
-import os
+ def SupportedForPage(self, page, tab):
+ pass
nduca 2012/11/07 18:55:57 return True?
marja 2012/11/08 10:24:00 Done. (Oops!)
+ def PerformInteraction(self, _, tab):
+ assert self._data['selector']
+ code = 'document.querySelector(\'' + self._data['selector'] + '\').click();'
+ def DoClick():
+ tab.runtime.Execute(code)
+ tab.page.PerformActionAndWaitForNavigate(DoClick)
-def GetExpectations(file_name):
- """Returns a list of test names in the |file_name| test expectations file."""
- if not file_name or not os.path.exists(file_name):
- return []
- return [x for x in [x.strip() for x in file(file_name).readlines()]
- if x and x[0] != '#']
+ def CleanUp(self, page, tab):
+ pass
-
-def SetLogLevel(verbose_count):
- """Sets log level as |verbose_count|."""
- log_level = logging.WARNING # Default.
- if verbose_count == 1:
- log_level = logging.INFO
- elif verbose_count >= 2:
- log_level = logging.DEBUG
- logging.getLogger().setLevel(log_level)
+page_interaction.RegisterClass('click_to_navigate', ClickToNavigateInteraction)

Powered by Google App Engine
This is Rietveld 408576698