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

Unified Diff: chrome/test/pyautolib/pyautolib.h

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
Index: chrome/test/pyautolib/pyautolib.h
diff --git a/chrome/test/pyautolib/pyautolib.h b/chrome/test/pyautolib/pyautolib.h
index 2901fed7d89dc0eaced4bea04836d37d5cefc1c2..f0f6617ac7191bb9b1184bcbbf40516abd652742 100644
--- a/chrome/test/pyautolib/pyautolib.h
+++ b/chrome/test/pyautolib/pyautolib.h
@@ -148,6 +148,22 @@ class PyUITestBase : public UITestBase {
// automation proxy additions. Returns response as JSON dict.
std::string _SendJSONRequest(int window_index, std::string& request);
+ // Execute javascript in a given tab, and return the response. This is
+ // a low-level method intended for use mostly by GetDOMValue(). Note that
+ // any complicated manipulation of the page should be done by something
+ // like WebDriver, not PyAuto.
John Grabowski 2010/08/03 06:42:45 Clarify that the only return value is something se
Dirk Pranke 2010/08/04 21:44:12 Done.
+ std::wstring ExecuteJavascript(const std::wstring& script,
+ int window_index = 0,
+ int tab_index = 0,
+ const std::wstring& frame_xpath = L"");
+
+ // Evaluate a Javascript expression and return the result as a string. This
+ // method is intended largely to read values out of the frame DOM.
+ std::wstring GetDOMValue(const std::wstring& expr,
+ int window_index = 0,
+ int tab_index = 0,
+ const std::wstring& frame_xpath = L"");
+
// Resets to the default theme. Returns true on success.
bool ResetToDefaultTheme();

Powered by Google App Engine
This is Rietveld 408576698