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

Unified Diff: tools/telemetry/telemetry/page/actions/click_element_unittest.py

Issue 100283003: Escape selectors before evaluating them (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « tools/telemetry/telemetry/page/actions/click_element.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/click_element_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/click_element_unittest.py b/tools/telemetry/telemetry/page/actions/click_element_unittest.py
index e0eec82fbfee27a0424a20ac989308a811803b88..2032d4f16c131d42e0864d5023b3c4d89484ac38 100644
--- a/tools/telemetry/telemetry/page/actions/click_element_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/click_element_unittest.py
@@ -27,6 +27,25 @@ class ClickElementActionTest(tab_test_case.TabTestCase):
self._tab.EvaluateJavaScript('document.location.pathname;'),
'/blank.html')
+ def testClickWithSingleQuoteSelectorWaitForNavigation(self):
+ self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
+ self._tab.Navigate(
+ self._browser.http_server.UrlOf('page_with_link.html'))
+ self._tab.WaitForDocumentReadyStateToBeComplete()
+ self.assertEquals(
+ self._tab.EvaluateJavaScript('document.location.pathname;'),
+ '/page_with_link.html')
+
+ data = {'selector': 'a[id=\'clickme\']'}
+ i = click_element.ClickElementAction(data)
+ data = {'condition': 'href_change'}
+ j = wait.WaitAction(data)
+ j.RunAction(None, self._tab, i)
+
+ self.assertEquals(
+ self._tab.EvaluateJavaScript('document.location.pathname;'),
+ '/blank.html')
+
def testClickWithTextWaitForRefChange(self):
self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
self._tab.Navigate(
« no previous file with comments | « tools/telemetry/telemetry/page/actions/click_element.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698