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

Side by Side Diff: chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 1995
1996 // Add initial bookmarks. 1996 // Add initial bookmarks.
1997 ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); 1997 ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL);
1998 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); 1998 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL);
1999 ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL); 1999 ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL);
2000 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2000 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2001 ASSERT_TRUE(AllModelsMatchVerifier()); 2001 ASSERT_TRUE(AllModelsMatchVerifier());
2002 2002
2003 // Set a passphrase and enable encryption on Client 0. Client 1 will not 2003 // Set a passphrase and enable encryption on Client 0. Client 1 will not
2004 // understand the bookmark updates. 2004 // understand the bookmark updates.
2005 GetSyncService(0)->SetEncryptionPassphrase(kValidPassphrase, 2005 GetSyncService(0)->SetEncryptionPassphrase(
2006 syncer::SyncService::EXPLICIT); 2006 kValidPassphrase, sync_driver::SyncService::EXPLICIT);
2007 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(0))); 2007 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(0)));
2008 ASSERT_TRUE(EnableEncryption(0)); 2008 ASSERT_TRUE(EnableEncryption(0));
2009 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2009 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2010 ASSERT_TRUE(IsEncryptionComplete(0)); 2010 ASSERT_TRUE(IsEncryptionComplete(0));
2011 ASSERT_TRUE(IsEncryptionComplete(1)); 2011 ASSERT_TRUE(IsEncryptionComplete(1));
2012 ASSERT_TRUE(GetSyncService(1)->IsPassphraseRequired()); 2012 ASSERT_TRUE(GetSyncService(1)->IsPassphraseRequired());
2013 2013
2014 // Client 1 adds bookmarks between the first two and between the second two. 2014 // Client 1 adds bookmarks between the first two and between the second two.
2015 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL); 2015 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL);
2016 ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL); 2016 ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 // second client. 2341 // second client.
2342 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS)); 2342 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS));
2343 const std::string url_title_2 = "another happy little url"; 2343 const std::string url_title_2 = "another happy little url";
2344 const GURL url_2("https://example.com/second"); 2344 const GURL url_2("https://example.com/second");
2345 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, url_title_2, url_2) != NULL); 2345 ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, url_title_2, url_2) != NULL);
2346 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS)); 2346 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS));
2347 ASSERT_TRUE(AwaitAllModelsMatch()); 2347 ASSERT_TRUE(AwaitAllModelsMatch());
2348 ASSERT_EQ(initial_count + 2, CountAllBookmarks(0)); 2348 ASSERT_EQ(initial_count + 2, CountAllBookmarks(0));
2349 ASSERT_EQ(initial_count + 2, CountAllBookmarks(1)); 2349 ASSERT_EQ(initial_count + 2, CountAllBookmarks(1));
2350 } 2350 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698