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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc

Issue 68483005: ProfileSyncServiceTest refactoring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac build Created 7 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 | « no previous file | chrome/browser/sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
index 9f5693fe378563881d48de9abcfa993c71301c1a..217ed048bdca546c5c4ea19e1f5c0ab123e8ee0d 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc
@@ -6,6 +6,7 @@
#include <cstddef>
+#include "base/file_util.h"
#include "base/location.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -687,6 +688,21 @@ TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) {
fake_manager_->GetAndResetConfigureReason());
}
+// It is SyncBackendHostCore responsibility to cleanup Sync Data folder if sync
+// setup hasn't been completed. This test ensures that cleanup happens.
+TEST_F(SyncBackendHostTest, TestStartupWithOldSyncData) {
+ const char* nonsense = "slon";
+ base::FilePath temp_directory =
+ profile_->GetPath().AppendASCII("Sync Data");
+ base::FilePath sync_file = temp_directory.AppendASCII("SyncData.sqlite3");
+ ASSERT_TRUE(file_util::CreateDirectory(temp_directory));
+ ASSERT_NE(-1, file_util::WriteFile(sync_file, nonsense, strlen(nonsense)));
+
+ InitializeBackend(true);
+
+ EXPECT_FALSE(base::PathExists(sync_file));
+}
+
} // namespace
} // namespace browser_sync
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698