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

Unified Diff: chrome/browser/browser_commands_unittest.cc

Issue 8956050: Rename TabContents::controller() to GetController and put it into the WebContents interface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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/background/background_contents_service.cc ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_commands_unittest.cc
===================================================================
--- chrome/browser/browser_commands_unittest.cc (revision 115228)
+++ chrome/browser/browser_commands_unittest.cc (working copy)
@@ -70,7 +70,7 @@
// Verify the stack of urls.
NavigationController& controller =
- browser()->GetTabContentsAt(1)->controller();
+ browser()->GetTabContentsAt(1)->GetController();
ASSERT_EQ(3, controller.entry_count());
ASSERT_EQ(2, controller.GetCurrentEntryIndex());
ASSERT_TRUE(url1 == controller.GetEntryAtIndex(0)->url());
@@ -118,14 +118,14 @@
// The original tab should be unchanged.
TabContents* zeroth = browser()->GetTabContentsAt(0);
EXPECT_EQ(url2, zeroth->GetURL());
- EXPECT_TRUE(zeroth->controller().CanGoBack());
- EXPECT_FALSE(zeroth->controller().CanGoForward());
+ EXPECT_TRUE(zeroth->GetController().CanGoBack());
+ EXPECT_FALSE(zeroth->GetController().CanGoForward());
// The new tab should be like the first one but navigated back.
TabContents* first = browser()->GetTabContentsAt(1);
EXPECT_EQ(url1, browser()->GetTabContentsAt(1)->GetURL());
- EXPECT_FALSE(first->controller().CanGoBack());
- EXPECT_TRUE(first->controller().CanGoForward());
+ EXPECT_FALSE(first->GetController().CanGoBack());
+ EXPECT_TRUE(first->GetController().CanGoForward());
// Select the second tab and make it go forward in a new background tab.
browser()->ActivateTabAt(1, true);
@@ -133,35 +133,35 @@
// but because of this bug, it will assert later if we don't. When the bug is
// fixed, one of the three commits here related to this bug should be removed
// (to test both codepaths).
- CommitPendingLoad(&first->controller());
+ CommitPendingLoad(&first->GetController());
EXPECT_EQ(1, browser()->active_index());
browser()->GoForward(NEW_BACKGROUND_TAB);
// The previous tab should be unchanged and still in the foreground.
EXPECT_EQ(url1, first->GetURL());
- EXPECT_FALSE(first->controller().CanGoBack());
- EXPECT_TRUE(first->controller().CanGoForward());
+ EXPECT_FALSE(first->GetController().CanGoBack());
+ EXPECT_TRUE(first->GetController().CanGoForward());
EXPECT_EQ(1, browser()->active_index());
// There should be a new tab navigated forward.
ASSERT_EQ(3, browser()->tab_count());
TabContents* second = browser()->GetTabContentsAt(2);
EXPECT_EQ(url2, second->GetURL());
- EXPECT_TRUE(second->controller().CanGoBack());
- EXPECT_FALSE(second->controller().CanGoForward());
+ EXPECT_TRUE(second->GetController().CanGoBack());
+ EXPECT_FALSE(second->GetController().CanGoForward());
// Now do back in a new foreground tab. Don't bother re-checking every sngle
// thing above, just validate that it's opening properly.
browser()->ActivateTabAt(2, true);
// TODO(brettw) bug 11055: see the comment above about why we need this.
- CommitPendingLoad(&second->controller());
+ CommitPendingLoad(&second->GetController());
browser()->GoBack(NEW_FOREGROUND_TAB);
ASSERT_EQ(3, browser()->active_index());
ASSERT_EQ(url1, browser()->GetSelectedTabContents()->GetURL());
// Same thing again for forward.
// TODO(brettw) bug 11055: see the comment above about why we need this.
- CommitPendingLoad(&browser()->GetSelectedTabContents()->controller());
+ CommitPendingLoad(&browser()->GetSelectedTabContents()->GetController());
browser()->GoForward(NEW_FOREGROUND_TAB);
ASSERT_EQ(4, browser()->active_index());
ASSERT_EQ(url2, browser()->GetSelectedTabContents()->GetURL());
« no previous file with comments | « chrome/browser/background/background_contents_service.cc ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698