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

Unified Diff: chrome/browser/memory/tab_manager_browsertest.cc

Issue 1427613002: [TabManager] Move remaining discard logic from TabStripModel to TabManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chrisha@ comments. Created 5 years, 2 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
« no previous file with comments | « chrome/browser/memory/tab_manager.cc ('k') | chrome/browser/memory/tab_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/tab_manager_browsertest.cc
diff --git a/chrome/browser/memory/tab_manager_browsertest.cc b/chrome/browser/memory/tab_manager_browsertest.cc
index bb0e948ac1cce252682d7620207eb18ce8c53100..e28ddde58f93000d7e60e6e9a99e90f940eba042 100644
--- a/chrome/browser/memory/tab_manager_browsertest.cc
+++ b/chrome/browser/memory/tab_manager_browsertest.cc
@@ -95,42 +95,31 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, TabManagerBasics) {
// and was not selected.
EXPECT_TRUE(tab_manager->DiscardTab());
EXPECT_EQ(3, tsm->count());
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(0)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(1)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(2)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2)));
EXPECT_TRUE(tab_manager->recent_tab_discard());
// Run discard again, make sure it kills the second tab.
EXPECT_TRUE(tab_manager->DiscardTab());
EXPECT_EQ(3, tsm->count());
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(0)));
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(1)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(2)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2)));
// Kill the third tab. It should not kill the last tab, since it is active
// tab.
EXPECT_FALSE(tab_manager->DiscardTab());
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(0)));
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(1)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(2)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2)));
// Kill the third tab after making second tab active.
tsm->ActivateTabAt(1, true);
EXPECT_EQ(1, tsm->active_index());
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(1)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1)));
tab_manager->DiscardWebContentsAt(2, tsm);
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(2)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2)));
// Force creation of the FindBarController.
browser()->GetFindBarController();
@@ -145,12 +134,9 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, TabManagerBasics) {
EXPECT_EQ(browser()->GetFindBarController()->web_contents(),
tsm->GetActiveWebContents());
EXPECT_EQ(0, tsm->active_index());
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(0)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(1)));
- EXPECT_TRUE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(2)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1)));
+ EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2)));
// Select the third tab. It should reload.
WindowedNotificationObserver reload2(
@@ -159,12 +145,9 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, TabManagerBasics) {
chrome::SelectNumberedTab(browser(), 2);
reload2.Wait();
EXPECT_EQ(2, tsm->active_index());
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(0)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(1)));
- EXPECT_FALSE(
- TabManager::WebContentsData::IsDiscarded(tsm->GetWebContentsAt(2)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(0)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1)));
+ EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2)));
// Navigate the third tab back twice. We used to crash here due to
// crbug.com/121373.
« no previous file with comments | « chrome/browser/memory/tab_manager.cc ('k') | chrome/browser/memory/tab_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698