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

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

Issue 13197004: Draft: InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes tests Created 7 years, 8 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 | Annotate | Revision Log
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 "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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 int rand_pos = base::RandInt(0, num_bookmarks-1); 1937 int rand_pos = base::RandInt(0, num_bookmarks-1);
1938 DVLOG(1) << "Moving client 0's bookmark " << i << " to position " 1938 DVLOG(1) << "Moving client 0's bookmark " << i << " to position "
1939 << rand_pos; 1939 << rand_pos;
1940 Move(0, node, node->parent(), rand_pos); 1940 Move(0, node, node->parent(), rand_pos);
1941 } 1941 }
1942 1942
1943 ASSERT_TRUE(AwaitQuiescence()); 1943 ASSERT_TRUE(AwaitQuiescence());
1944 ASSERT_TRUE(AllModelsMatch()); 1944 ASSERT_TRUE(AllModelsMatch());
1945 } 1945 }
1946 1946
1947 // Restart the sync service on one client and make sure all data is synced when
1948 // the service restarts.
1949 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest,
1950 DISABLED_RestartSyncService) {
1951 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1952
1953 ASSERT_TRUE(AddURL(0, L"Google", GURL("http://www.google.com")));
1954 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
1955 ASSERT_TRUE(AllModelsMatchVerifier());
1956
1957 RestartSyncService(0);
1958 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Restarted sync."));
1959 ASSERT_TRUE(AllModelsMatchVerifier());
1960 }
1961
1962 // Trigger the server side creation of Synced Bookmarks. Ensure both clients 1947 // Trigger the server side creation of Synced Bookmarks. Ensure both clients
1963 // remain syncing afterwards. Add bookmarks to the synced bookmarks folder 1948 // remain syncing afterwards. Add bookmarks to the synced bookmarks folder
1964 // and ensure both clients receive the boomkmark. 1949 // and ensure both clients receive the boomkmark.
1965 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, CreateSyncedBookmarks) { 1950 IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, CreateSyncedBookmarks) {
1966 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 1951 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
1967 ASSERT_TRUE(AllModelsMatchVerifier()); 1952 ASSERT_TRUE(AllModelsMatchVerifier());
1968 1953
1969 TriggerCreateSyncedBookmarks(); 1954 TriggerCreateSyncedBookmarks();
1970 1955
1971 // Add a bookmark on Client 0 and ensure it syncs over. This will also trigger 1956 // Add a bookmark on Client 0 and ensure it syncs over. This will also trigger
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 2011
2027 // Remove all 2012 // Remove all
2028 RemoveAll(0); 2013 RemoveAll(0);
2029 2014
2030 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 2015 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
2031 // Verify other node has no children now. 2016 // Verify other node has no children now.
2032 EXPECT_EQ(0, GetOtherNode(0)->child_count()); 2017 EXPECT_EQ(0, GetOtherNode(0)->child_count());
2033 EXPECT_EQ(0, GetBookmarkBarNode(0)->child_count()); 2018 EXPECT_EQ(0, GetBookmarkBarNode(0)->child_count());
2034 ASSERT_TRUE(AllModelsMatch()); 2019 ASSERT_TRUE(AllModelsMatch());
2035 } 2020 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698