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

Unified Diff: chrome/browser/printing/print_preview_tab_controller_browsertest.cc

Issue 7790020: Cleanup: Convert PrintPreviewTabController to use TabContentsWrapper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/printing/print_preview_tab_controller_browsertest.cc
===================================================================
--- chrome/browser/printing/print_preview_tab_controller_browsertest.cc (revision 98744)
+++ chrome/browser/printing/print_preview_tab_controller_browsertest.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/printing/print_preview_tab_controller.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -28,7 +29,8 @@
EXPECT_EQ(1, browser()->tab_count());
// Create a reference to initiator tab contents.
- TabContents* initiator_tab = browser()->GetSelectedTabContents();
+ TabContentsWrapper* initiator_tab =
+ browser()->GetSelectedTabContentsWrapper();
ASSERT_TRUE(initiator_tab);
scoped_refptr<printing::PrintPreviewTabController>
@@ -36,7 +38,7 @@
ASSERT_TRUE(tab_controller);
// Get the preview tab for initiator tab.
- TabContents* preview_tab =
+ TabContentsWrapper* preview_tab =
tab_controller->GetOrCreatePreviewTab(initiator_tab);
// New print preview tab is created. Current focus is on preview tab.
@@ -45,10 +47,10 @@
GURL url(chrome::kAboutBlankURL);
ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(url, preview_tab->GetURL());
+ EXPECT_EQ(url, preview_tab->tab_contents()->GetURL());
// Get the print preview tab for initiator tab.
- TabContents* new_preview_tab =
+ TabContentsWrapper* new_preview_tab =
tab_controller->GetOrCreatePreviewTab(initiator_tab);
// New preview tab is created.
@@ -56,7 +58,7 @@
EXPECT_NE(new_preview_tab, preview_tab);
// Get the print preview tab for old preview tab.
- TabContents* newest_preview_tab =
+ TabContentsWrapper* newest_preview_tab =
tab_controller->GetOrCreatePreviewTab(preview_tab);
// Newest preview tab is created and the previously created preview tab is not
@@ -79,7 +81,8 @@
EXPECT_EQ(1, browser()->tab_count());
// Create a reference to initiator tab contents.
- TabContents* initiator_tab = browser()->GetSelectedTabContents();
+ TabContentsWrapper* initiator_tab =
+ browser()->GetSelectedTabContentsWrapper();
ASSERT_TRUE(initiator_tab);
scoped_refptr<printing::PrintPreviewTabController>
@@ -87,7 +90,7 @@
ASSERT_TRUE(tab_controller);
// Get the preview tab for initiator tab.
- TabContents* preview_tab =
+ TabContentsWrapper* preview_tab =
tab_controller->GetOrCreatePreviewTab(initiator_tab);
// New print preview tab is created. Current focus is on preview tab.
@@ -100,7 +103,7 @@
ui_test_utils::NavigateToURL(browser(), url);
// Get the print preview tab for initiator tab.
- TabContents* new_preview_tab =
+ TabContentsWrapper* new_preview_tab =
tab_controller->GetOrCreatePreviewTab(initiator_tab);
// New preview tab is created.
@@ -108,7 +111,7 @@
EXPECT_NE(new_preview_tab, preview_tab);
// Get the print preview tab for old preview tab.
- TabContents* newest_preview_tab =
+ TabContentsWrapper* newest_preview_tab =
tab_controller->GetOrCreatePreviewTab(preview_tab);
// Make sure preview tab is not created for |preview_tab|.
@@ -129,7 +132,8 @@
EXPECT_EQ(1, browser()->tab_count());
// Create a reference to initiator tab contents.
- TabContents* initiator_tab = browser()->GetSelectedTabContents();
+ TabContentsWrapper* initiator_tab =
+ browser()->GetSelectedTabContentsWrapper();
ASSERT_TRUE(initiator_tab);
scoped_refptr<printing::PrintPreviewTabController>
@@ -137,7 +141,7 @@
ASSERT_TRUE(tab_controller);
// Get the preview tab for initiator tab.
- TabContents* preview_tab =
+ TabContentsWrapper* preview_tab =
tab_controller->GetOrCreatePreviewTab(initiator_tab);
// New print preview tab is created. Current focus is on preview tab.
@@ -149,7 +153,7 @@
browser()->Reload(CURRENT_TAB);
// Get the print preview tab for initiator tab.
- TabContents* new_preview_tab =
+ TabContentsWrapper* new_preview_tab =
tab_controller->GetOrCreatePreviewTab(initiator_tab);
// Old preview tab is activated.
@@ -159,7 +163,7 @@
// Reload preview tab.
browser()->Reload(CURRENT_TAB);
// Get the print preview tab for old preview tab.
- TabContents* newest_preview_tab =
+ TabContentsWrapper* newest_preview_tab =
tab_controller->GetOrCreatePreviewTab(preview_tab);
// Make sure new preview tab is not created for |preview_tab|.

Powered by Google App Engine
This is Rietveld 408576698