| Index: content/public/test/browser_test_utils.h
|
| ===================================================================
|
| --- content/public/test/browser_test_utils.h (revision 148111)
|
| +++ content/public/test/browser_test_utils.h (working copy)
|
| @@ -35,6 +35,7 @@
|
| namespace content {
|
|
|
| class MessageLoopRunner;
|
| +class RenderViewHost;
|
| class WebContents;
|
|
|
| // Simulates clicking at the center of the given tab asynchronously.
|
| @@ -53,6 +54,34 @@
|
| bool alt,
|
| bool command);
|
|
|
| +// Executes the passed |script| in the frame pointed to by |frame_xpath| (use
|
| +// empty string for main frame). The |script| should not invoke
|
| +// domAutomationController.send(); otherwise, your test will hang or be flaky.
|
| +// If you want to extract a result, use one of the below functions.
|
| +// Returns true on success.
|
| +bool ExecuteJavaScript(RenderViewHost* render_view_host,
|
| + const std::wstring& frame_xpath,
|
| + const std::wstring& script) WARN_UNUSED_RESULT;
|
| +
|
| +// The following methods executes the passed |script| in the frame pointed to by
|
| +// |frame_xpath| (use empty string for main frame) and sets |result| to the
|
| +// value returned by the script evaluation.
|
| +// They return true on success, false if the script evaluation failed or did not
|
| +// evaluate to the expected type.
|
| +bool ExecuteJavaScriptAndExtractInt(RenderViewHost* render_view_host,
|
| + const std::wstring& frame_xpath,
|
| + const std::wstring& script,
|
| + int* result) WARN_UNUSED_RESULT;
|
| +bool ExecuteJavaScriptAndExtractBool(RenderViewHost* render_view_host,
|
| + const std::wstring& frame_xpath,
|
| + const std::wstring& script,
|
| + bool* result) WARN_UNUSED_RESULT;
|
| +bool ExecuteJavaScriptAndExtractString(
|
| + RenderViewHost* render_view_host,
|
| + const std::wstring& frame_xpath,
|
| + const std::wstring& script,
|
| + std::string* result) WARN_UNUSED_RESULT;
|
| +
|
| // Watches title changes on a tab, blocking until an expected title is set.
|
| class TitleWatcher : public NotificationObserver {
|
| public:
|
|
|