Index: chrome/browser/memory/tab_manager_unittest.cc |
diff --git a/chrome/browser/memory/tab_manager_unittest.cc b/chrome/browser/memory/tab_manager_unittest.cc |
index 59b93b6cec30027077c4c3b79573c61c3c5583ad..8cfb4e37c786306c9494333158a92cd6bd286a42 100644 |
--- a/chrome/browser/memory/tab_manager_unittest.cc |
+++ b/chrome/browser/memory/tab_manager_unittest.cc |
@@ -681,7 +681,9 @@ TEST_F(TabManagerTest, NextPurgeAndSuspendState) { |
WebContents* test_contents = CreateWebContents(); |
tabstrip.AppendWebContents(test_contents, false); |
- base::TimeDelta threshold = base::TimeDelta::FromSeconds(180); |
+ // Use default time-to-first-suspension seconds defined in TabManager. |
+ base::TimeDelta threshold = base::TimeDelta::FromSeconds( |
+ TabManager::kDefaultTimeToFirstSuspensionSeconds); |
base::SimpleTestTickClock test_clock; |
tab_manager.GetWebContentsData(test_contents) |
@@ -689,11 +691,13 @@ TEST_F(TabManagerTest, NextPurgeAndSuspendState) { |
tab_manager.GetWebContentsData(test_contents) |
->SetLastPurgeAndSuspendModifiedTimeForTesting(test_clock.NowTicks()); |
- test_clock.Advance(base::TimeDelta::FromSeconds(180)); |
+ // Wait 30 minutes. Should be still RUNNING. |
+ test_clock.Advance(base::TimeDelta::FromMinutes(30)); |
EXPECT_EQ(TabManager::RUNNING, |
tab_manager.GetNextPurgeAndSuspendState( |
test_contents, test_clock.NowTicks(), threshold)); |
+ // > 30 minutes. Should be still SUSPENDED. |
test_clock.Advance(base::TimeDelta::FromSeconds(1)); |
EXPECT_EQ(TabManager::SUSPENDED, |
tab_manager.GetNextPurgeAndSuspendState( |