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

Unified Diff: chrome/browser/profiles/profile_info_cache_unittest.cc

Issue 134863002: Track when profiles are last used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
Index: chrome/browser/profiles/profile_info_cache_unittest.cc
diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc
index 571411501df6202e6bf58638e5e5fc9f24df01b3..a0e8ab5bad559fd02aade374aee462ac767320b5 100644
--- a/chrome/browser/profiles/profile_info_cache_unittest.cc
+++ b/chrome/browser/profiles/profile_info_cache_unittest.cc
@@ -9,6 +9,7 @@
#include "base/prefs/testing_pref_service.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
@@ -307,6 +308,18 @@ TEST_F(ProfileInfoCacheTest, HasMigrated) {
EXPECT_FALSE(GetCache()->GetHasMigratedToGAIAInfoOfProfileAtIndex(1));
}
+TEST_F(ProfileInfoCacheTest, ProfileActive) {
+ GetCache()->AddProfileToCache(
+ GetProfilePath("path_1"), ASCIIToUTF16("name_1"),
+ base::string16(), 0, std::string());
+ EXPECT_EQ(base::Time(), GetCache()->GetProfileActive(0));
+ base::Time before = base::Time::Now();
+ GetCache()->SetProfileActive(0);
+ base::Time after = base::Time::Now();
+ EXPECT_LE(before, GetCache()->GetProfileActive(0));
+ EXPECT_GE(after, GetCache()->GetProfileActive(0));
+}
+
TEST_F(ProfileInfoCacheTest, GAIAName) {
GetCache()->AddProfileToCache(
GetProfilePath("path_1"), ASCIIToUTF16("name_1"),

Powered by Google App Engine
This is Rietveld 408576698