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

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

Issue 2354613002: [Sync] Fix namespaces for the browser_sync component. (Closed)
Patch Set: Address comments. Created 4 years, 3 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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 1994
1995 // Add initial bookmarks. 1995 // Add initial bookmarks.
1996 ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); 1996 ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL);
1997 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); 1997 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL);
1998 ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL); 1998 ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL);
1999 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 1999 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2000 ASSERT_TRUE(AllModelsMatchVerifier()); 2000 ASSERT_TRUE(AllModelsMatchVerifier());
2001 2001
2002 // Set a passphrase and enable encryption on Client 0. Client 1 will not 2002 // Set a passphrase and enable encryption on Client 0. Client 1 will not
2003 // understand the bookmark updates. 2003 // understand the bookmark updates.
2004 SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); 2004 SetEncryptionPassphrase(0, kValidPassphrase,
2005 browser_sync::ProfileSyncService::EXPLICIT);
2005 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService((0)))); 2006 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService((0))));
2006 ASSERT_TRUE(EnableEncryption(0)); 2007 ASSERT_TRUE(EnableEncryption(0));
2007 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2008 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2008 ASSERT_TRUE(IsEncryptionComplete(0)); 2009 ASSERT_TRUE(IsEncryptionComplete(0));
2009 ASSERT_TRUE(IsEncryptionComplete(1)); 2010 ASSERT_TRUE(IsEncryptionComplete(1));
2010 ASSERT_TRUE(GetSyncService((1))->IsPassphraseRequired()); 2011 ASSERT_TRUE(GetSyncService((1))->IsPassphraseRequired());
2011 2012
2012 // Client 1 adds bookmarks between the first two and between the second two. 2013 // Client 1 adds bookmarks between the first two and between the second two.
2013 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL); 2014 ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL);
2014 ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL); 2015 ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2340 // second client. 2341 // second client.
2341 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS)); 2342 ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS));
2342 const std::string url_title_2 = "another happy little url"; 2343 const std::string url_title_2 = "another happy little url";
2343 const GURL url_2("https://example.com/second"); 2344 const GURL url_2("https://example.com/second");
2344 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);
2345 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS)); 2346 ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS));
2346 ASSERT_TRUE(AwaitAllModelsMatch()); 2347 ASSERT_TRUE(AwaitAllModelsMatch());
2347 ASSERT_EQ(initial_count + 2, CountAllBookmarks(0)); 2348 ASSERT_EQ(initial_count + 2, CountAllBookmarks(0));
2348 ASSERT_EQ(initial_count + 2, CountAllBookmarks(1)); 2349 ASSERT_EQ(initial_count + 2, CountAllBookmarks(1));
2349 } 2350 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698