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..91293fa87d02f198845287cf35833dd74f94f5f6 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::kDefaultTimeToFirstPurgeInSeconds); |
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. |
Wez
2017/02/22 01:25:10
nit: Comment style is to prefer complete sentences
tasak
2017/02/22 04:18:46
Done.
|
+ 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. |
Wez
2017/02/22 01:25:10
Do you mean "Should _now_ be SUSPENDED."?
tasak
2017/02/22 04:18:46
Yes, thanks.
Done.
|
test_clock.Advance(base::TimeDelta::FromSeconds(1)); |
EXPECT_EQ(TabManager::SUSPENDED, |
tab_manager.GetNextPurgeAndSuspendState( |