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

Unified Diff: chrome/browser/browser_browsertest.cc

Issue 6312154: Remove wstring from RVH's run Javascript command.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/browser_browsertest.cc
===================================================================
--- chrome/browser/browser_browsertest.cc (revision 73805)
+++ chrome/browser/browser_browsertest.cc (working copy)
@@ -47,12 +47,12 @@
namespace {
-const std::string BEFORE_UNLOAD_HTML =
+const char* BEFORE_UNLOAD_HTML =
"<html><head><title>beforeunload</title></head><body>"
"<script>window.onbeforeunload=function(e){return 'foo'}</script>"
"</body></html>";
-const std::wstring OPEN_NEW_BEFOREUNLOAD_PAGE =
+const wchar_t* OPEN_NEW_BEFOREUNLOAD_PAGE =
Evan Martin 2011/02/04 21:37:29 char* Can you fix these to kOpenNewBeforeUnloadPa
Avi (use Gerrit) 2011/02/04 23:02:11 Done.
L"w=window.open(); w.onbeforeunload=function(e){return 'foo'};";
const FilePath::CharType* kTitle1File = FILE_PATH_LITERAL("title1.html");
@@ -211,8 +211,9 @@
EXPECT_EQ(0, browser()->selected_index());
TabContents* second_tab = browser()->GetTabContentsAt(1);
ASSERT_TRUE(second_tab);
- second_tab->render_view_host()->ExecuteJavascriptInWebFrame(L"",
- L"alert('Activate!');");
+ second_tab->render_view_host()->ExecuteJavascriptInWebFrame(
+ string16(),
+ ASCIIToUTF16("alert('Activate!');"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
alert->CloseModalDialog();
EXPECT_EQ(2, browser()->tab_count());
@@ -246,7 +247,7 @@
// Test for crbug.com/22004. Reloading a page with a before unload handler and
// then canceling the dialog should not leave the throbber spinning.
IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) {
- GURL url("data:text/html," + BEFORE_UNLOAD_HTML);
+ GURL url(std::string("data:text/html,") + BEFORE_UNLOAD_HTML);
ui_test_utils::NavigateToURL(browser(), url);
// Navigate to another page, but click cancel in the dialog. Make sure that
@@ -258,7 +259,8 @@
// Clear the beforeunload handler so the test can easily exit.
browser()->GetSelectedTabContents()->render_view_host()->
- ExecuteJavascriptInWebFrame(L"", L"onbeforeunload=null;");
+ ExecuteJavascriptInWebFrame(string16(),
+ ASCIIToUTF16("onbeforeunload=null;"));
}
// Crashy on mac. http://crbug.com/38522
@@ -274,13 +276,15 @@
// two beforeunload dialogs shown.
IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_SingleBeforeUnloadAfterWindowClose) {
browser()->GetSelectedTabContents()->render_view_host()->
- ExecuteJavascriptInWebFrame(L"", OPEN_NEW_BEFOREUNLOAD_PAGE);
+ ExecuteJavascriptInWebFrame(string16(),
+ WideToUTF16(OPEN_NEW_BEFOREUNLOAD_PAGE));
Evan Martin 2011/02/04 21:37:29 ASCIIToUTF16 once char* change
Avi (use Gerrit) 2011/02/04 23:02:11 Done.
// Close the new window with JavaScript, which should show a single
// beforeunload dialog. Then show another alert, to make it easy to verify
// that a second beforeunload dialog isn't shown.
browser()->GetTabContentsAt(0)->render_view_host()->
- ExecuteJavascriptInWebFrame(L"", L"w.close(); alert('bar');");
+ ExecuteJavascriptInWebFrame(string16(),
+ ASCIIToUTF16("w.close(); alert('bar');"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
alert->native_dialog()->AcceptAppModalDialog();

Powered by Google App Engine
This is Rietveld 408576698