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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 11734018: Revert 174880 due to compilation error in pdf_browsertest.cc (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1374/src/
Patch Set: Created 7 years, 12 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 | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
===================================================================
--- content/public/test/browser_test_utils.cc (revision 174946)
+++ content/public/test/browser_test_utils.cc (working copy)
@@ -33,6 +33,7 @@
static const int kDefaultWsPort = 8880;
namespace content {
+
namespace {
class DOMOperationObserver : public NotificationObserver,
@@ -78,24 +79,24 @@
// Specifying a prototype so that we can add the WARN_UNUSED_RESULT attribute.
bool ExecuteJavaScriptHelper(RenderViewHost* render_view_host,
- const std::string& frame_xpath,
- const std::string& original_script,
+ const std::wstring& frame_xpath,
+ const std::wstring& original_script,
scoped_ptr<Value>* result) WARN_UNUSED_RESULT;
// Executes the passed |original_script| in the frame pointed to by
// |frame_xpath|. If |result| is not NULL, stores the value that the evaluation
// of the script in |result|. Returns true on success.
bool ExecuteJavaScriptHelper(RenderViewHost* render_view_host,
- const std::string& frame_xpath,
- const std::string& original_script,
+ const std::wstring& frame_xpath,
+ const std::wstring& original_script,
scoped_ptr<Value>* result) {
// TODO(jcampan): we should make the domAutomationController not require an
// automation id.
- std::string script =
- "window.domAutomationController.setAutomationId(0);" + original_script;
+ std::wstring script = L"window.domAutomationController.setAutomationId(0);" +
+ original_script;
DOMOperationObserver dom_op_observer(render_view_host);
- render_view_host->ExecuteJavascriptInWebFrame(UTF8ToUTF16(frame_xpath),
- UTF8ToUTF16(script));
+ render_view_host->ExecuteJavascriptInWebFrame(WideToUTF16Hack(frame_xpath),
+ WideToUTF16Hack(script));
std::string json;
if (!dom_op_observer.WaitAndGetResponse(&json)) {
DLOG(ERROR) << "Cannot communicate with DOMOperationObserver.";
@@ -280,16 +281,16 @@
}
bool ExecuteJavaScript(RenderViewHost* render_view_host,
- const std::string& frame_xpath,
- const std::string& original_script) {
- std::string script =
- original_script + ";window.domAutomationController.send(0);";
+ const std::wstring& frame_xpath,
+ const std::wstring& original_script) {
+ std::wstring script =
+ original_script + L";window.domAutomationController.send(0);";
return ExecuteJavaScriptHelper(render_view_host, frame_xpath, script, NULL);
}
bool ExecuteJavaScriptAndExtractInt(RenderViewHost* render_view_host,
- const std::string& frame_xpath,
- const std::string& script,
+ const std::wstring& frame_xpath,
+ const std::wstring& script,
int* result) {
DCHECK(result);
scoped_ptr<Value> value;
@@ -301,8 +302,8 @@
}
bool ExecuteJavaScriptAndExtractBool(RenderViewHost* render_view_host,
- const std::string& frame_xpath,
- const std::string& script,
+ const std::wstring& frame_xpath,
+ const std::wstring& script,
bool* result) {
DCHECK(result);
scoped_ptr<Value> value;
@@ -314,8 +315,8 @@
}
bool ExecuteJavaScriptAndExtractString(RenderViewHost* render_view_host,
- const std::string& frame_xpath,
- const std::string& script,
+ const std::wstring& frame_xpath,
+ const std::wstring& script,
std::string* result) {
DCHECK(result);
scoped_ptr<Value> value;
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698