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

Unified Diff: chrome/browser/download/download_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/download/download_browsertest.cc
===================================================================
--- chrome/browser/download/download_browsertest.cc (revision 145001)
+++ chrome/browser/download/download_browsertest.cc (working copy)
@@ -39,6 +39,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/chrome_notification_types.h"
@@ -651,7 +652,7 @@
ASSERT_TRUE(url.is_valid()) << s.str();
DownloadManager* download_manager = DownloadManagerForBrowser(browser());
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
ASSERT_TRUE(web_contents) << s.str();
scoped_ptr<DownloadTestObserver> observer(
@@ -960,7 +961,7 @@
EXPECT_TRUE(EnsureNoPendingDownloads());
// Disable downloads for the tab.
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
DownloadRequestLimiter::TabDownloadState* tab_download_state =
g_browser_process->download_request_limiter()->GetDownloadState(
web_contents, web_contents, true);
@@ -977,7 +978,7 @@
1);
bool download_assempted;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
- browser()->GetActiveWebContents()->GetRenderViewHost(),
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
L"",
L"window.domAutomationController.send(startDownload());",
&download_assempted));
@@ -1038,8 +1039,8 @@
// Open a second tab and wait.
EXPECT_NE(static_cast<TabContents*>(NULL),
- browser()->AddSelectedTabWithURL(
- GURL(), content::PAGE_TRANSITION_TYPED));
+ chrome::AddSelectedTabWithURL(browser(), GURL(),
+ content::PAGE_TRANSITION_TYPED));
EXPECT_EQ(2, browser()->tab_count());
EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
@@ -1048,7 +1049,7 @@
EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
// Go to the first tab.
- browser()->ActivateTabAt(0, true);
+ chrome::ActivateTabAt(browser(), 0, true);
EXPECT_EQ(2, browser()->tab_count());
// The download shelf should not be visible.
@@ -1554,7 +1555,7 @@
ui_test_utils::NavigateToURL(browser(), flags_url);
DownloadAndWait(browser(), download_url, EXPECT_NO_SELECT_DIALOG);
ui_test_utils::NavigateToURL(browser(), extensions_url);
- WebContents* contents = browser()->GetActiveWebContents();
+ WebContents* contents = chrome::GetActiveWebContents(browser());
ASSERT_TRUE(contents);
bool webui_responded = false;
EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
@@ -1574,7 +1575,7 @@
GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file));
ui_test_utils::NavigateToURL(browser(), downloads_url);
- WebContents* contents = browser()->GetActiveWebContents();
+ WebContents* contents = chrome::GetActiveWebContents(browser());
ASSERT_TRUE(contents);
bool result = false;
EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
@@ -1934,7 +1935,7 @@
// DownloadUrl always prompts; return acceptance of whatever it prompts.
NullSelectFile(browser());
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
ASSERT_TRUE(web_contents);
DownloadTestObserver* observer(
@@ -1962,7 +1963,7 @@
FilePath file(FILE_PATH_LITERAL("download-test1.lib"));
GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
ASSERT_TRUE(web_contents);
ScopedTempDir other_directory;
@@ -2032,7 +2033,7 @@
context_menu_params.media_type = WebKit::WebContextMenuData::MediaTypeImage;
context_menu_params.src_url = url;
context_menu_params.page_url = url;
- TestRenderViewContextMenu menu(browser()->GetActiveWebContents(),
+ TestRenderViewContextMenu menu(chrome::GetActiveWebContents(browser()),
context_menu_params);
menu.Init();
menu.ExecuteCommand(IDC_CONTENT_CONTEXT_SAVEIMAGEAS);
@@ -2069,7 +2070,7 @@
// which normally requires revalidation each time.
GURL jpeg_url = test_server()->GetURL("files/post/downloads/image.jpg");
ASSERT_TRUE(jpeg_url.is_valid());
- WebContents* web_contents = browser()->GetActiveWebContents();
+ WebContents* web_contents = chrome::GetActiveWebContents(browser());
ASSERT_TRUE(web_contents != NULL);
ui_test_utils::WindowedNotificationObserver observer(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
@@ -2429,7 +2430,7 @@
// Click on the link with the alt key pressed. This will download the link
// target.
- WebContents* tab = browser()->GetActiveWebContents();
+ WebContents* tab = chrome::GetActiveWebContents(browser());
WebKit::WebMouseEvent mouse_event;
mouse_event.type = WebKit::WebInputEvent::MouseDown;
mouse_event.button = WebKit::WebMouseEvent::ButtonLeft;

Powered by Google App Engine
This is Rietveld 408576698