| 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 "base/rand_util.h" | 5 #include "base/rand_util.h" |
| 6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| 9 #include "chrome/browser/sync/test/integration/passwords_helper.h" | 9 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
| 10 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
| (...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 DISABLED_RestartSyncService) { | 1908 DISABLED_RestartSyncService) { |
| 1909 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1909 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1910 | 1910 |
| 1911 ASSERT_TRUE(AddURL(0, L"Google", GURL("http://www.google.com"))); | 1911 ASSERT_TRUE(AddURL(0, L"Google", GURL("http://www.google.com"))); |
| 1912 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1912 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1913 ASSERT_TRUE(AllModelsMatchVerifier()); | 1913 ASSERT_TRUE(AllModelsMatchVerifier()); |
| 1914 | 1914 |
| 1915 RestartSyncService(0); | 1915 RestartSyncService(0); |
| 1916 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Restarted sync.")); | 1916 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Restarted sync.")); |
| 1917 ASSERT_TRUE(AllModelsMatchVerifier()); | 1917 ASSERT_TRUE(AllModelsMatchVerifier()); |
| 1918 ASSERT_EQ(0, GetClient(0)->GetStatus().unsynced_count); | |
| 1919 } | 1918 } |
| 1920 | 1919 |
| 1921 // Trigger the server side creation of Synced Bookmarks. Ensure both clients | 1920 // Trigger the server side creation of Synced Bookmarks. Ensure both clients |
| 1922 // remain syncing afterwards. Add bookmarks to the synced bookmarks folder | 1921 // remain syncing afterwards. Add bookmarks to the synced bookmarks folder |
| 1923 // and ensure both clients receive the boomkmark. | 1922 // and ensure both clients receive the boomkmark. |
| 1924 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, CreateSyncedBookmarks) { | 1923 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, CreateSyncedBookmarks) { |
| 1925 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1924 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1926 ASSERT_TRUE(AllModelsMatchVerifier()); | 1925 ASSERT_TRUE(AllModelsMatchVerifier()); |
| 1927 | 1926 |
| 1928 TriggerCreateSyncedBookmarks(); | 1927 TriggerCreateSyncedBookmarks(); |
| 1929 | 1928 |
| 1930 // Add a bookmark on Client 0 and ensure it syncs over. This will also trigger | 1929 // Add a bookmark on Client 0 and ensure it syncs over. This will also trigger |
| 1931 // both clients downloading the new Synced Bookmarks folder. | 1930 // both clients downloading the new Synced Bookmarks folder. |
| 1932 ASSERT_TRUE(AddURL(0, L"Google", GURL("http://www.google.com"))); | 1931 ASSERT_TRUE(AddURL(0, L"Google", GURL("http://www.google.com"))); |
| 1933 ASSERT_TRUE(AwaitQuiescence()); | 1932 ASSERT_TRUE(AwaitQuiescence()); |
| 1934 ASSERT_TRUE(AllModelsMatch()); | 1933 ASSERT_TRUE(AllModelsMatch()); |
| 1935 | 1934 |
| 1936 // Now add a bookmark within the Synced Bookmarks folder and ensure it syncs | 1935 // Now add a bookmark within the Synced Bookmarks folder and ensure it syncs |
| 1937 // over. | 1936 // over. |
| 1938 const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0); | 1937 const BookmarkNode* synced_bookmarks = GetSyncedBookmarksNode(0); |
| 1939 ASSERT_TRUE(synced_bookmarks); | 1938 ASSERT_TRUE(synced_bookmarks); |
| 1940 ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, L"Google2", | 1939 ASSERT_TRUE(AddURL(0, synced_bookmarks, 0, L"Google2", |
| 1941 GURL("http://www.google2.com"))); | 1940 GURL("http://www.google2.com"))); |
| 1942 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1941 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1943 ASSERT_TRUE(AllModelsMatch()); | 1942 ASSERT_TRUE(AllModelsMatch()); |
| 1944 } | 1943 } |
| OLD | NEW |