| OLD | NEW | 
|     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 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1992  |  1992  | 
|  1993   // Add initial bookmarks. |  1993   // Add initial bookmarks. | 
|  1994   ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); |  1994   ASSERT_TRUE(AddURL(0, 0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); | 
|  1995   ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); |  1995   ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); | 
|  1996   ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL); |  1996   ASSERT_TRUE(AddURL(0, 2, IndexedURLTitle(2), GURL(IndexedURL(2))) != NULL); | 
|  1997   ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |  1997   ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 
|  1998   ASSERT_TRUE(AllModelsMatchVerifier()); |  1998   ASSERT_TRUE(AllModelsMatchVerifier()); | 
|  1999  |  1999  | 
|  2000   // Set a passphrase and enable encryption on Client 0. Client 1 will not |  2000   // Set a passphrase and enable encryption on Client 0. Client 1 will not | 
|  2001   // understand the bookmark updates. |  2001   // understand the bookmark updates. | 
|  2002   GetSyncService(0)->SetEncryptionPassphrase( |  2002   GetSyncService(0)->SetEncryptionPassphrase(kValidPassphrase, | 
|  2003       kValidPassphrase, sync_driver::SyncService::EXPLICIT); |  2003                                              syncer::SyncService::EXPLICIT); | 
|  2004   ASSERT_TRUE(PassphraseAcceptedChecker(GetSyncService(0)).Wait()); |  2004   ASSERT_TRUE(PassphraseAcceptedChecker(GetSyncService(0)).Wait()); | 
|  2005   ASSERT_TRUE(EnableEncryption(0)); |  2005   ASSERT_TRUE(EnableEncryption(0)); | 
|  2006   ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |  2006   ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 
|  2007   ASSERT_TRUE(IsEncryptionComplete(0)); |  2007   ASSERT_TRUE(IsEncryptionComplete(0)); | 
|  2008   ASSERT_TRUE(IsEncryptionComplete(1)); |  2008   ASSERT_TRUE(IsEncryptionComplete(1)); | 
|  2009   ASSERT_TRUE(GetSyncService(1)->IsPassphraseRequired()); |  2009   ASSERT_TRUE(GetSyncService(1)->IsPassphraseRequired()); | 
|  2010  |  2010  | 
|  2011   // Client 1 adds bookmarks between the first two and between the second two. |  2011   // Client 1 adds bookmarks between the first two and between the second two. | 
|  2012   ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL); |  2012   ASSERT_TRUE(AddURL(0, 1, IndexedURLTitle(3), GURL(IndexedURL(3))) != NULL); | 
|  2013   ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL); |  2013   ASSERT_TRUE(AddURL(0, 3, IndexedURLTitle(4), GURL(IndexedURL(4))) != NULL); | 
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2338   // second client. |  2338   // second client. | 
|  2339   ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS)); |  2339   ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS)); | 
|  2340   const std::string url_title_2 = "another happy little url"; |  2340   const std::string url_title_2 = "another happy little url"; | 
|  2341   const GURL url_2("https://example.com/second"); |  2341   const GURL url_2("https://example.com/second"); | 
|  2342   ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, url_title_2, url_2) != NULL); |  2342   ASSERT_TRUE(AddURL(0, GetBookmarkBarNode(0), 0, url_title_2, url_2) != NULL); | 
|  2343   ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS)); |  2343   ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::BOOKMARKS)); | 
|  2344   ASSERT_TRUE(BookmarksMatchChecker().Wait()); |  2344   ASSERT_TRUE(BookmarksMatchChecker().Wait()); | 
|  2345   ASSERT_EQ(initial_count + 2, CountAllBookmarks(0)); |  2345   ASSERT_EQ(initial_count + 2, CountAllBookmarks(0)); | 
|  2346   ASSERT_EQ(initial_count + 2, CountAllBookmarks(1)); |  2346   ASSERT_EQ(initial_count + 2, CountAllBookmarks(1)); | 
|  2347 } |  2347 } | 
| OLD | NEW |