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

Unified Diff: chrome/test/functional/execute_javascript.py

Issue 3012039: Add ExecuteJavascript() method to PyUITestBase (Closed)
Patch Set: merge to head Created 10 years, 5 months 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 | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | chrome/test/pyautolib/pyauto.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/execute_javascript.py
diff --git a/chrome/test/functional/execute_javascript.py b/chrome/test/functional/execute_javascript.py
new file mode 100644
index 0000000000000000000000000000000000000000..cfc8f18bfa73259797825bc5d85eff765d7a0a24
--- /dev/null
+++ b/chrome/test/functional/execute_javascript.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# Copyright (c) 2010 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
+import sys
+import unittest
+
+import pyauto_functional
+from pyauto import PyUITest
+
+
+class ExecuteJavascriptTest(PyUITest):
+
+ def testExecuteJavascript(self):
+ path = os.path.join(self.DataDir(), "frame_dom_access",
+ "frame_dom_access.html")
+
+ # FIXME: I'm not sure if this path will work on windows.
+ self.NavigateToURL("file://%s" % path)
+
+ v = self.ExecuteJavascript("window.domAutomationController.send(" +
+ "document.getElementById('myinput').nodeName)")
+ self.assertEqual(v, "INPUT")
+
+ def testGetDOMValue(self):
+ path = os.path.join(self.DataDir(), "frame_dom_access",
+ "frame_dom_access.html")
+
+ # FIXME: I'm not sure if this path will work on windows.
+ self.NavigateToURL("file://%s" % path)
+
+ v = self.GetDOMValue("document.getElementById('myinput').nodeName")
+ self.assertEqual(v, "INPUT")
+
+
+if __name__ == '__main__':
+ pyauto_functional.Main()
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyauto.py » ('j') | chrome/test/pyautolib/pyauto.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698