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

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc

Issue 11753009: Simplify ExecuteJavaScript* functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update prerender_browsertest.cc. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_commands.h" 7 #include "chrome/browser/ui/browser_commands.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 15 matching lines...) Expand all
26 NewTabUIBrowserTest() {} 26 NewTabUIBrowserTest() {}
27 }; 27 };
28 28
29 // Ensure that chrome-internal: still loads the NTP. 29 // Ensure that chrome-internal: still loads the NTP.
30 // See http://crbug.com/6564. 30 // See http://crbug.com/6564.
31 IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, ChromeInternalLoadsNTP) { 31 IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, ChromeInternalLoadsNTP) {
32 // Go to the "new tab page" using its old url, rather than chrome://newtab. 32 // Go to the "new tab page" using its old url, rather than chrome://newtab.
33 // Ensure that we get there by checking for non-empty page content. 33 // Ensure that we get there by checking for non-empty page content.
34 ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal:")); 34 ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal:"));
35 bool empty_inner_html = false; 35 bool empty_inner_html = false;
36 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( 36 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
37 browser()->tab_strip_model()->GetWebContentsAt(0)->GetRenderViewHost(), 37 browser()->tab_strip_model()->GetWebContentsAt(0),
38 "",
39 "window.domAutomationController.send(document.body.innerHTML == '')", 38 "window.domAutomationController.send(document.body.innerHTML == '')",
40 &empty_inner_html)); 39 &empty_inner_html));
41 ASSERT_FALSE(empty_inner_html); 40 ASSERT_FALSE(empty_inner_html);
42 } 41 }
43 42
44 // Ensure loading a NTP with an existing SiteInstance in a reused process 43 // Ensure loading a NTP with an existing SiteInstance in a reused process
45 // doesn't cause us to kill the process. See http://crbug.com/104258. 44 // doesn't cause us to kill the process. See http://crbug.com/104258.
46 IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, LoadNTPInExistingProcess) { 45 IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, LoadNTPInExistingProcess) {
47 // Set max renderers to 1 to force running out of processes. 46 // Set max renderers to 1 to force running out of processes.
48 content::RenderProcessHost::SetMaxRendererProcessCount(1); 47 content::RenderProcessHost::SetMaxRendererProcessCount(1);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 150
152 // We don't use ui_test_utils::NavigateToURLWithDisposition because that waits 151 // We don't use ui_test_utils::NavigateToURLWithDisposition because that waits
153 // for current loading to stop. 152 // for current loading to stop.
154 content::TestNavigationObserver observer( 153 content::TestNavigationObserver observer(
155 content::NotificationService::AllSources()); 154 content::NotificationService::AllSources());
156 browser()->OpenURL(OpenURLParams( 155 browser()->OpenURL(OpenURLParams(
157 GURL("data:text/html,hello world"), Referrer(), CURRENT_TAB, 156 GURL("data:text/html,hello world"), Referrer(), CURRENT_TAB,
158 content::PAGE_TRANSITION_TYPED, false)); 157 content::PAGE_TRANSITION_TYPED, false));
159 observer.Wait(); 158 observer.Wait();
160 } 159 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/inspect_ui_browsertest.cc ('k') | chrome/browser/ui/webui/options/options_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698