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

Unified Diff: chrome/browser/sync/test/integration/single_client_directory_sync_test.cc

Issue 2424533002: Modify sync unit test to use standard sql::test:: helper. (Closed)
Patch Set: BUILD.gn merge Created 4 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 | « no previous file | components/sync/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/single_client_directory_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc b/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc
index 72b63cd294e7f5cf2bbcc3ea4dd6217a568d8258..b29d1034749281db48fa3fb9838cb29061f4e3d5 100644
--- a/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc
@@ -16,13 +16,11 @@
#include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/sync/syncable/directory.h"
-#include "components/sync/test/directory_backing_store_corruption_testing.h"
#include "content/public/browser/browser_thread.h"
+#include "sql/test/test_helpers.h"
#include "url/gurl.h"
using content::BrowserThread;
-using syncer::syncable::corruption_testing::kNumEntriesRequiredForCorruption;
-using syncer::syncable::corruption_testing::CorruptDatabase;
class SingleClientDirectorySyncTest : public SyncTest {
public:
@@ -105,23 +103,14 @@ IN_PROC_BROWSER_TEST_F(SingleClientDirectorySyncTest,
const base::FilePath directory_path(sync_service->GetDirectoryPathForTest());
const base::FilePath sync_db(directory_path.Append(
syncer::syncable::Directory::kSyncDatabaseFilename));
- ASSERT_TRUE(CorruptDatabase(sync_db));
-
- // Write a bunch of bookmarks and flush the directory to ensure sync notices
- // the corruption. The key here is to force sync to actually write a lot of
- // data to its DB so it will see the corruption we introduced above.
- const GURL url(
- "https://"
- "www."
- "gooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
- "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
- "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
- "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
- "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
- "oooooooooooooooooooogle.com");
+ ASSERT_TRUE(sql::test::CorruptSizeInHeaderWithLock(sync_db));
+
+ // Write some bookmarks and flush the directory to force sync to
+ // notice the corruption.
+ const GURL url("https://www.example.com");
const bookmarks::BookmarkNode* top = bookmarks_helper::AddFolder(
0, bookmarks_helper::GetOtherNode(0), 0, "top");
- for (int i = 0; i < kNumEntriesRequiredForCorruption; ++i) {
+ for (int i = 0; i < 100; ++i) {
ASSERT_TRUE(
bookmarks_helper::AddURL(0, top, 0, base::Int64ToString(i), url));
}
« no previous file with comments | « no previous file | components/sync/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698