diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 20:39:01 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-23 20:39:01 +0000 |
commit | ca25209a0338e538e0199b07bbd5c2411f52e906 (patch) | |
tree | c4cb2c20599249e0c8a23b6424551280dfc6fd15 /webkit/appcache/appcache_group_unittest.cc | |
parent | 1ce698cdc9cec84dcd0eea437f266d5e0b217060 (diff) | |
download | chromium_src-ca25209a0338e538e0199b07bbd5c2411f52e906.zip chromium_src-ca25209a0338e538e0199b07bbd5c2411f52e906.tar.gz chromium_src-ca25209a0338e538e0199b07bbd5c2411f52e906.tar.bz2 |
Keep track of appcache creation and last access times.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/630009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_group_unittest.cc')
-rw-r--r-- | webkit/appcache/appcache_group_unittest.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/webkit/appcache/appcache_group_unittest.cc b/webkit/appcache/appcache_group_unittest.cc index 180cc3a..3508ace 100644 --- a/webkit/appcache/appcache_group_unittest.cc +++ b/webkit/appcache/appcache_group_unittest.cc @@ -79,38 +79,38 @@ TEST(AppCacheGroupTest, AddRemoveCache) { scoped_refptr<AppCacheGroup> group = new AppCacheGroup(&service, GURL("http://foo.com"), 111); - base::TimeTicks ticks = base::TimeTicks::Now(); + base::Time now = base::Time::Now(); scoped_refptr<AppCache> cache1 = new AppCache(&service, 111); cache1->set_complete(true); - cache1->set_update_time(ticks); + cache1->set_update_time(now); group->AddCache(cache1); EXPECT_EQ(cache1, group->newest_complete_cache()); // Adding older cache does not change newest complete cache. scoped_refptr<AppCache> cache2 = new AppCache(&service, 222); cache2->set_complete(true); - cache2->set_update_time(ticks - base::TimeDelta::FromDays(1)); + cache2->set_update_time(now - base::TimeDelta::FromDays(1)); group->AddCache(cache2); EXPECT_EQ(cache1, group->newest_complete_cache()); // Adding newer cache does change newest complete cache. scoped_refptr<AppCache> cache3 = new AppCache(&service, 333); cache3->set_complete(true); - cache3->set_update_time(ticks + base::TimeDelta::FromDays(1)); + cache3->set_update_time(now + base::TimeDelta::FromDays(1)); group->AddCache(cache3); EXPECT_EQ(cache3, group->newest_complete_cache()); // Adding cache with same update time uses one with larger ID. scoped_refptr<AppCache> cache4 = new AppCache(&service, 444); cache4->set_complete(true); - cache4->set_update_time(ticks + base::TimeDelta::FromDays(1)); // same as 3 + cache4->set_update_time(now + base::TimeDelta::FromDays(1)); // same as 3 group->AddCache(cache4); EXPECT_EQ(cache4, group->newest_complete_cache()); scoped_refptr<AppCache> cache5 = new AppCache(&service, 55); // smaller id cache5->set_complete(true); - cache5->set_update_time(ticks + base::TimeDelta::FromDays(1)); // same as 4 + cache5->set_update_time(now + base::TimeDelta::FromDays(1)); // same as 4 group->AddCache(cache5); EXPECT_EQ(cache4, group->newest_complete_cache()); // no change @@ -152,11 +152,11 @@ TEST(AppCacheGroupTest, CleanupUnusedGroup) { AppCacheHost host1(1, &frontend, &service); AppCacheHost host2(2, &frontend, &service); - base::TimeTicks ticks = base::TimeTicks::Now(); + base::Time now = base::Time::Now(); AppCache* cache1 = new AppCache(&service, 111); cache1->set_complete(true); - cache1->set_update_time(ticks); + cache1->set_update_time(now); group->AddCache(cache1); EXPECT_EQ(cache1, group->newest_complete_cache()); @@ -172,7 +172,7 @@ TEST(AppCacheGroupTest, CleanupUnusedGroup) { AppCache* cache2 = new AppCache(&service, 222); cache2->set_complete(true); - cache2->set_update_time(ticks + base::TimeDelta::FromDays(1)); + cache2->set_update_time(now + base::TimeDelta::FromDays(1)); group->AddCache(cache2); EXPECT_EQ(cache2, group->newest_complete_cache()); |