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

Unified Diff: chrome/browser/instant/instant_browsertest.cc

Issue 11728003: Change ExecuteJavaScript* helper functions in browser_test_utils.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding files for gpu_tests and NaCl browser tests. 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
Index: chrome/browser/instant/instant_browsertest.cc
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index 797688c1ca0b17bc956c1a98e63106cc38ac0fa1..90ec7a33eee78532433392fb2ea84a1b6fd12d29 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -105,8 +105,7 @@ class InstantTest : public InProcessBrowserTest {
if (omnibox()->model()->has_focus()) {
instant()->OmniboxFocusChanged(OMNIBOX_FOCUS_VISIBLE,
OMNIBOX_FOCUS_CHANGE_EXPLICIT, NULL);
- }
- else {
+ } else {
browser()->window()->GetLocationBar()->FocusLocation(false);
}
}
@@ -131,29 +130,30 @@ class InstantTest : public InProcessBrowserTest {
observer.WaitUntilDesiredPreviewState();
}
- std::wstring WrapScript(const std::string& script) const {
- return UTF8ToWide("domAutomationController.send(" + script + ")");
+ std::string WrapScript(const std::string& script) const {
+ return "domAutomationController.send(" + script + ")";
}
bool GetBoolFromJS(content::RenderViewHost* rvh,
const std::string& script,
bool* result) WARN_UNUSED_RESULT {
- return content::ExecuteJavaScriptAndExtractBool(rvh, std::wstring(),
- WrapScript(script), result);
+ return content::ExecuteJavaScriptAndExtractBool(rvh, "", WrapScript(script),
+ result);
}
bool GetIntFromJS(content::RenderViewHost* rvh,
const std::string& script,
int* result) WARN_UNUSED_RESULT {
- return content::ExecuteJavaScriptAndExtractInt(rvh, std::wstring(),
- WrapScript(script), result);
+ return content::ExecuteJavaScriptAndExtractInt(rvh, "", WrapScript(script),
+ result);
}
bool GetStringFromJS(content::RenderViewHost* rvh,
const std::string& script,
std::string* result) WARN_UNUSED_RESULT {
- return content::ExecuteJavaScriptAndExtractString(
- rvh, std::wstring(), WrapScript(script), result);
+ return content::ExecuteJavaScriptAndExtractString(rvh, "",
+ WrapScript(script),
+ result);
}
bool UpdateSearchState(content::WebContents* contents) WARN_UNUSED_RESULT {
@@ -170,8 +170,9 @@ class InstantTest : public InProcessBrowserTest {
bool ExecuteScript(const std::string& script) WARN_UNUSED_RESULT {
return content::ExecuteJavaScript(
- instant()->GetPreviewContents()->GetRenderViewHost(), std::wstring(),
- UTF8ToWide(script));
+ instant()->GetPreviewContents()->GetRenderViewHost(),
+ "",
+ script);
}
bool CheckVisibilityIs(content::WebContents* contents,
« no previous file with comments | « chrome/browser/history/history_browsertest.cc ('k') | chrome/browser/loadtimes_extension_bindings_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698