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

Unified Diff: chrome/browser/ui/browser_browsertest.cc

Issue 518583003: Don't take a fake UGI every time we execute Javascript. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix styling Created 6 years, 3 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 | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/test/base/tracing_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_browsertest.cc
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index b9df8659b6a8d0e841354f3f383964a5272d48d1..a98d5231f89b0414b3c1aefb3da7cacdb2c5aee4 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -796,13 +796,13 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) {
// two beforeunload dialogs shown.
IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_SingleBeforeUnloadAfterWindowClose) {
browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()->
- ExecuteJavaScript(ASCIIToUTF16(kOpenNewBeforeUnloadPage));
+ ExecuteJavaScriptForTests(ASCIIToUTF16(kOpenNewBeforeUnloadPage));
// 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()->tab_strip_model()->GetWebContentsAt(0)->GetMainFrame()->
- ExecuteJavaScript(ASCIIToUTF16("w.close(); alert('bar');"));
+ ExecuteJavaScriptForTests(ASCIIToUTF16("w.close(); alert('bar');"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
alert->native_dialog()->AcceptAppModalDialog();
@@ -958,7 +958,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) {
content::WindowedNotificationObserver nav_observer(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
- oldtab->GetMainFrame()->ExecuteJavaScript(ASCIIToUTF16(redirect_popup));
+ oldtab->GetMainFrame()->
+ ExecuteJavaScriptForTests(ASCIIToUTF16(redirect_popup));
// Wait for popup window to appear and finish navigating.
popup_observer.Wait();
@@ -991,7 +992,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) {
content::WindowedNotificationObserver nav_observer2(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
- oldtab->GetMainFrame()->ExecuteJavaScript(ASCIIToUTF16(refresh_popup));
+ oldtab->GetMainFrame()->
+ ExecuteJavaScriptForTests(ASCIIToUTF16(refresh_popup));
// Wait for popup window to appear and finish navigating.
popup_observer2.Wait();
@@ -1044,7 +1046,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) {
content::WindowedNotificationObserver nav_observer(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
- oldtab->GetMainFrame()->ExecuteJavaScript(ASCIIToUTF16(dont_fork_popup));
+ oldtab->GetMainFrame()->
+ ExecuteJavaScriptForTests(ASCIIToUTF16(dont_fork_popup));
// Wait for popup window to appear and finish navigating.
popup_observer.Wait();
@@ -1070,7 +1073,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) {
content::WindowedNotificationObserver nav_observer2(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
- oldtab->GetMainFrame()->ExecuteJavaScript(ASCIIToUTF16(navigate_str));
+ oldtab->GetMainFrame()->ExecuteJavaScriptForTests(ASCIIToUTF16(navigate_str));
nav_observer2.Wait();
ASSERT_TRUE(oldtab->GetController().GetLastCommittedEntry());
EXPECT_EQ(https_url.spec(),
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/test/base/tracing_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698