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

Unified Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 690153002: [Sync] Fix bug where DeviceInfo is missing a backup timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
Patch Set: Created 6 years, 2 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/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc
index accbcb4c5317b70bc97622746a1613e14663f4ed..6a5262eeb87c6efdc12b045e1acf15ef916c0dad 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
+#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
@@ -35,6 +36,7 @@
#include "google_apis/gaia/gaia_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/l10n/l10n_util.h"
namespace content {
class BrowserContext;
@@ -616,5 +618,24 @@ TEST_F(ProfileSyncServiceTest, GetSyncServiceURL) {
ProfileSyncService::GetSyncServiceURL(command_line).spec());
}
+// Verify that LastSyncedTime is cleared when the user signs out.
+TEST_F(ProfileSyncServiceTest, ClearLastSyncedTimeOnSignOut) {
+ IssueTestTokens();
+ CreateService(AUTO_START);
+ ExpectDataTypeManagerCreation(1);
+ ExpectSyncBackendHostCreation(1);
+ InitializeForNthSync();
+ EXPECT_TRUE(service()->SyncActive());
+ EXPECT_EQ(l10n_util::GetStringUTF16(IDS_SYNC_TIME_JUST_NOW),
+ service()->GetLastSyncedTimeString());
+
+ // Sign out.
+ service()->DisableForUser();
+ PumpLoop();
+
+ EXPECT_EQ(l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER),
+ service()->GetLastSyncedTimeString());
+}
+
} // namespace
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698