From 52877dbc6c22a02dc7d1dd6f22de2c2b3e7eac17 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Fri, 29 Jun 2012 22:22:03 +0000 Subject: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. http://crbug.com/133576 TEST=none Review URL: https://chromiumcodereview.appspot.com/10702029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145015 0039d316-1c4b-4281-b951-d872f2087c98 --- .../chromeos/oom_priority_manager_browsertest.cc | 34 ++++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'chrome/browser/chromeos/oom_priority_manager_browsertest.cc') diff --git a/chrome/browser/chromeos/oom_priority_manager_browsertest.cc b/chrome/browser/chromeos/oom_priority_manager_browsertest.cc index a0abb6f..4d85eec 100644 --- a/chrome/browser/chromeos/oom_priority_manager_browsertest.cc +++ b/chrome/browser/chromeos/oom_priority_manager_browsertest.cc @@ -6,7 +6,9 @@ #include "chrome/browser/chromeos/oom_priority_manager.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" @@ -79,22 +81,22 @@ IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) { // and was not selected. EXPECT_TRUE(g_browser_process->oom_priority_manager()->DiscardTab()); EXPECT_EQ(3, browser()->tab_count()); - EXPECT_TRUE(browser()->IsTabDiscarded(0)); - EXPECT_FALSE(browser()->IsTabDiscarded(1)); - EXPECT_FALSE(browser()->IsTabDiscarded(2)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(0)); + EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(1)); + EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(2)); // Run discard again, make sure it kills the second tab. g_browser_process->oom_priority_manager()->DiscardTab(); EXPECT_EQ(3, browser()->tab_count()); - EXPECT_TRUE(browser()->IsTabDiscarded(0)); - EXPECT_TRUE(browser()->IsTabDiscarded(1)); - EXPECT_FALSE(browser()->IsTabDiscarded(2)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(0)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(1)); + EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(2)); // Kill the third tab EXPECT_TRUE(g_browser_process->oom_priority_manager()->DiscardTab()); - EXPECT_TRUE(browser()->IsTabDiscarded(0)); - EXPECT_TRUE(browser()->IsTabDiscarded(1)); - EXPECT_TRUE(browser()->IsTabDiscarded(2)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(0)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(1)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(2)); // Running when all tabs are discarded should do nothing. EXPECT_FALSE(g_browser_process->oom_priority_manager()->DiscardTab()); @@ -110,11 +112,11 @@ IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) { reload1.Wait(); // Make sure the FindBarController gets the right TabContents. EXPECT_EQ(browser()->GetFindBarController()->tab_contents(), - browser()->GetActiveTabContents()); + chrome::GetActiveTabContents(browser())); EXPECT_EQ(0, browser()->active_index()); - EXPECT_FALSE(browser()->IsTabDiscarded(0)); - EXPECT_TRUE(browser()->IsTabDiscarded(1)); - EXPECT_TRUE(browser()->IsTabDiscarded(2)); + EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(0)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(1)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(2)); // Select the third tab. It should reload. WindowedNotificationObserver reload2( @@ -123,9 +125,9 @@ IN_PROC_BROWSER_TEST_F(OomPriorityManagerTest, OomPriorityManagerBasics) { chrome::SelectNumberedTab(browser(), 2); reload2.Wait(); EXPECT_EQ(2, browser()->active_index()); - EXPECT_FALSE(browser()->IsTabDiscarded(0)); - EXPECT_TRUE(browser()->IsTabDiscarded(1)); - EXPECT_FALSE(browser()->IsTabDiscarded(2)); + EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(0)); + EXPECT_TRUE(browser()->tab_strip_model()->IsTabDiscarded(1)); + EXPECT_FALSE(browser()->tab_strip_model()->IsTabDiscarded(2)); // Navigate the third tab back twice. We used to crash here due to // crbug.com/121373. -- cgit v1.1