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() |