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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/inspector_page_unittest.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/inspector_page_unittest.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/inspector_page_unittest.py b/tools/chrome_remote_control/chrome_remote_control/inspector_page_unittest.py
index 7b6df9990ae9d678e54a435beb0542d2bf13c4bb..bdf7c5ff719bb82661e35c1d3a4bb81f376eb743 100644
--- a/tools/chrome_remote_control/chrome_remote_control/inspector_page_unittest.py
+++ b/tools/chrome_remote_control/chrome_remote_control/inspector_page_unittest.py
@@ -1,9 +1,15 @@
# 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.
+import os
+
from chrome_remote_control import tab_test_case
class InspectorPageTest(tab_test_case.TabTestCase):
+ def __init__(self, *args):
+ super(InspectorPageTest, self).__init__(*args)
+ self._custom_action_called = False
+
def testPageNavigateToNormalUrl(self):
self._tab.page.Navigate('http://www.google.com')
self._tab.WaitForDocumentReadyStateToBeComplete()
@@ -17,3 +23,24 @@ class InspectorPageTest(tab_test_case.TabTestCase):
def testPageNavigateToImpossibleURL(self):
self._tab.page.Navigate('http://23f09f0f9fsdflajsfaldfkj2f3f.com')
self._tab.WaitForDocumentReadyStateToBeComplete()
+
+ def testCustomActionToNavigate(self):
+ unittest_data_dir = os.path.join(os.path.dirname(__file__),
+ '..', 'unittest_data')
+ self._browser.SetHTTPServerDirectory(unittest_data_dir)
+ self._tab.page.Navigate(
+ self._browser.http_server.UrlOf('page_with_link.html'))
+ self._tab.WaitForDocumentReadyStateToBeComplete()
+ self.assertEquals(self._tab.runtime.Evaluate('document.location.pathname;'),
+ '/page_with_link.html')
+
+ self._custom_action_called = False
+ def CustomAction():
+ self._custom_action_called = True
+ self._tab.runtime.Execute('document.getElementById("clickme").click();')
+
+ self._tab.page.PerformActionAndWaitForNavigate(CustomAction)
+
+ self.assertTrue(self._custom_action_called)
+ self.assertEquals(self._tab.runtime.Evaluate('document.location.pathname;'),
+ '/blank.html')

Powered by Google App Engine
This is Rietveld 408576698