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

Unified Diff: chrome/browser/ui/webui/web_ui_test_handler.cc

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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/browser/ui/webui/web_ui_test_handler.cc
diff --git a/chrome/browser/ui/webui/web_ui_test_handler.cc b/chrome/browser/ui/webui/web_ui_test_handler.cc
index 8cf270e574cef94e3631fbfee1049c300d0b1dab..d4e03aabba7aa0e4ab592b4240a8a8ca67d6bae6 100644
--- a/chrome/browser/ui/webui/web_ui_test_handler.cc
+++ b/chrome/browser/ui/webui/web_ui_test_handler.cc
@@ -37,7 +37,8 @@ void WebUITestHandler::PreloadJavaScript(const base::string16& js_text,
}
void WebUITestHandler::RunJavaScript(const base::string16& js_text) {
- web_ui()->GetWebContents()->GetMainFrame()->ExecuteJavaScript(js_text);
+ web_ui()->GetWebContents()->GetMainFrame()->ExecuteJavaScriptForTests(
+ js_text);
}
bool WebUITestHandler::RunJavaScriptTestWithResult(
@@ -45,9 +46,9 @@ bool WebUITestHandler::RunJavaScriptTestWithResult(
test_succeeded_ = false;
run_test_succeeded_ = false;
content::RenderFrameHost* frame = web_ui()->GetWebContents()->GetMainFrame();
- frame->ExecuteJavaScript(js_text,
- base::Bind(&WebUITestHandler::JavaScriptComplete,
- base::Unretained(this)));
+ frame->ExecuteJavaScriptForTests(
+ js_text, base::Bind(&WebUITestHandler::JavaScriptComplete,
+ base::Unretained(this)));
return WaitForResult();
}

Powered by Google App Engine
This is Rietveld 408576698