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

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

Issue 2471613003: Reland of Add Resume logic of Purge+Suspend to TabManager. (Closed)
Patch Set: Created 4 years, 1 month 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_web_contents_data.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_web_contents_data_unittest.cc
diff --git a/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc b/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc
index 9c1cd3dfcb8c6abb59275faefce4ba0be27c7286..d98afa8c040ba8f22578bfbdcfe61c7a0af2a4da 100644
--- a/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc
+++ b/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc
@@ -207,19 +207,22 @@
TEST_F(TabManagerWebContentsDataTest, PurgeAndSuspendState) {
EXPECT_EQ(TabManager::RUNNING, tab_data()->GetPurgeAndSuspendState());
base::TimeTicks last_modified = tab_data()->LastPurgeAndSuspendModifiedTime();
+ test_clock().Advance(base::TimeDelta::FromSeconds(5));
tab_data()->SetPurgeAndSuspendState(TabManager::SUSPENDED);
EXPECT_EQ(TabManager::SUSPENDED, tab_data()->GetPurgeAndSuspendState());
EXPECT_GT(tab_data()->LastPurgeAndSuspendModifiedTime(), last_modified);
last_modified = tab_data()->LastPurgeAndSuspendModifiedTime();
+ test_clock().Advance(base::TimeDelta::FromSeconds(5));
tab_data()->SetPurgeAndSuspendState(TabManager::RESUMED);
EXPECT_EQ(TabManager::RESUMED, tab_data()->GetPurgeAndSuspendState());
- EXPECT_GE(tab_data()->LastPurgeAndSuspendModifiedTime(), last_modified);
+ EXPECT_GT(tab_data()->LastPurgeAndSuspendModifiedTime(), last_modified);
last_modified = tab_data()->LastPurgeAndSuspendModifiedTime();
+ test_clock().Advance(base::TimeDelta::FromSeconds(5));
tab_data()->SetPurgeAndSuspendState(TabManager::RUNNING);
EXPECT_EQ(TabManager::RUNNING, tab_data()->GetPurgeAndSuspendState());
- EXPECT_GE(tab_data()->LastPurgeAndSuspendModifiedTime(), last_modified);
+ EXPECT_GT(tab_data()->LastPurgeAndSuspendModifiedTime(), last_modified);
}
} // namespace memory
« no previous file with comments | « chrome/browser/memory/tab_manager_web_contents_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698