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

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

Issue 2704443006: Make time_to_first_suspension's default 1800sec (Closed)
Patch Set: Fixed style. Created 3 years, 10 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c20c3946fc9d2b29eb99a79ca8ccaea6b7079005 100644
--- a/chrome/browser/memory/tab_manager_unittest.cc
+++ b/chrome/browser/memory/tab_manager_unittest.cc
@@ -681,7 +681,8 @@ 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-purge defined in TabManager.
+ base::TimeDelta threshold = TabManager::kDefaultTimeToFirstPurge;
base::SimpleTestTickClock test_clock;
tab_manager.GetWebContentsData(test_contents)
@@ -689,11 +690,13 @@ TEST_F(TabManagerTest, NextPurgeAndSuspendState) {
tab_manager.GetWebContentsData(test_contents)
->SetLastPurgeAndSuspendModifiedTimeForTesting(test_clock.NowTicks());
- test_clock.Advance(base::TimeDelta::FromSeconds(180));
+ // Wait 30 minutes and verify that the tab is still RUNNING.
+ test_clock.Advance(base::TimeDelta::FromMinutes(30));
EXPECT_EQ(TabManager::RUNNING,
tab_manager.GetNextPurgeAndSuspendState(
test_contents, test_clock.NowTicks(), threshold));
+ // Wait another second and verify that it is now SUSPENDED.
test_clock.Advance(base::TimeDelta::FromSeconds(1));
EXPECT_EQ(TabManager::SUSPENDED,
tab_manager.GetNextPurgeAndSuspendState(
« no previous file with comments | « chrome/browser/memory/tab_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698