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

Unified Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/prerender/prerender_browsertest.cc
===================================================================
--- chrome/browser/prerender/prerender_browsertest.cc (revision 145001)
+++ chrome/browser/prerender/prerender_browsertest.cc (working copy)
@@ -28,6 +28,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/common/chrome_notification_types.h"
@@ -638,7 +639,7 @@
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
RenderViewHost* render_view_host =
- current_browser()->GetActiveWebContents()->GetRenderViewHost();
+ chrome::GetActiveWebContents(current_browser())->GetRenderViewHost();
render_view_host->ExecuteJavascriptInWebFrame(
string16(),
ASCIIToUTF16("ClickOpenLink()"));
@@ -670,8 +671,8 @@
back_nav_observer.Wait();
bool original_prerender_page = false;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
- current_browser()->GetActiveWebContents()->GetRenderViewHost(), L"",
- L"window.domAutomationController.send(IsOriginalPrerenderPage())",
+ chrome::GetActiveWebContents(current_browser())->GetRenderViewHost(),
+ L"", L"window.domAutomationController.send(IsOriginalPrerenderPage())",
&original_prerender_page));
EXPECT_TRUE(original_prerender_page);
}
@@ -680,7 +681,7 @@
// in. This must be called when the prerendered page is the current page
// in the active tab.
void GoBackToPageBeforePrerender() {
- WebContents* tab = current_browser()->GetActiveWebContents();
+ WebContents* tab = chrome::GetActiveWebContents(current_browser());
ASSERT_TRUE(tab);
EXPECT_FALSE(tab->IsLoading());
ui_test_utils::WindowedNotificationObserver back_nav_observer(
@@ -728,16 +729,15 @@
}
PrerenderManager* GetPrerenderManager() const {
- Profile* profile = current_browser()->GetActiveTabContents()->profile();
PrerenderManager* prerender_manager =
- PrerenderManagerFactory::GetForProfile(profile);
+ PrerenderManagerFactory::GetForProfile(current_browser()->profile());
return prerender_manager;
}
const PrerenderLinkManager* GetPrerenderLinkManager() const {
- Profile* profile = current_browser()->GetActiveTabContents()->profile();
PrerenderLinkManager* prerender_link_manager =
- PrerenderLinkManagerFactory::GetForProfile(profile);
+ PrerenderLinkManagerFactory::GetForProfile(
+ current_browser()->profile());
return prerender_link_manager;
}
@@ -948,7 +948,7 @@
ASSERT_TRUE(prerender_contents != NULL);
RenderViewHost* render_view_host =
- current_browser()->GetActiveWebContents()->GetRenderViewHost();
+ chrome::GetActiveWebContents(current_browser())->GetRenderViewHost();
render_view_host->ExecuteJavascriptInWebFrame(
string16(),
ASCIIToUTF16(javascript_function_name));
@@ -1113,7 +1113,7 @@
// TODO(mmenke): While this should reliably fail on regressions, the
// reliability depends on the specifics of ppapi plugin
// loading. It would be great if we could avoid that.
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
bool display_test_result = false;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
web_contents->GetRenderViewHost(), L"",
@@ -1606,7 +1606,7 @@
#else
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderWindowSize) {
#endif
- ui_test_utils::CloseAllInfoBars(browser()->GetActiveTabContents());
+ ui_test_utils::CloseAllInfoBars(chrome::GetActiveTabContents(browser()));
PrerenderTestURL("files/prerender/prerender_size.html",
FINAL_STATUS_USED,
@@ -2034,7 +2034,7 @@
PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
string16 expected_title = ASCIIToUTF16("Unloaded");
ui_test_utils::TitleWatcher title_watcher(
- current_browser()->GetActiveWebContents(), expected_title);
+ chrome::GetActiveWebContents(current_browser()), expected_title);
NavigateToDestURL();
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -2161,7 +2161,7 @@
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NavigateToPrerenderedPageWhenDevToolsAttached) {
DisableJavascriptCalls();
- WebContents* web_contents = current_browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(current_browser());
DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost(
web_contents->GetRenderViewHost());
DevToolsManager* manager = DevToolsManager::GetInstance();
@@ -2229,7 +2229,7 @@
// To avoid any chance of a race, we have to let the script send its response
// asynchronously.
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
bool display_test_result = false;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
web_contents->GetRenderViewHost(), L"",
« no previous file with comments | « chrome/browser/prerender/prefetch_browsertest.cc ('k') | chrome/browser/printing/print_preview_tab_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698