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

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

Issue 1137543002: Sync: add a test for downloading a tombstoned bookmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing 1st round of comments Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/sync/test/integration/p2p_sync_refresher.h" 5 #include "chrome/browser/sync/test/integration/p2p_sync_refresher.h"
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/sync/profile_sync_service.h" 8 #include "chrome/browser/sync/profile_sync_service.h"
9 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" 9 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
10 #include "chrome/browser/sync/test/integration/sync_test.h" 10 #include "chrome/browser/sync/test/integration/sync_test.h"
(...skipping 14 matching lines...) Expand all
25 void P2PSyncRefresher::OnSyncCycleCompleted() { 25 void P2PSyncRefresher::OnSyncCycleCompleted() {
26 const syncer::sessions::SyncSessionSnapshot& snap = 26 const syncer::sessions::SyncSessionSnapshot& snap =
27 sync_service_->GetLastSessionSnapshot(); 27 sync_service_->GetLastSessionSnapshot();
28 bool is_notifiable_commit = 28 bool is_notifiable_commit =
29 (snap.model_neutral_state().num_successful_commits > 0); 29 (snap.model_neutral_state().num_successful_commits > 0);
30 if (is_notifiable_commit) { 30 if (is_notifiable_commit) {
31 syncer::ModelTypeSet model_types = 31 syncer::ModelTypeSet model_types =
32 snap.model_neutral_state().commit_request_types; 32 snap.model_neutral_state().commit_request_types;
33 SyncTest* test = sync_datatype_helper::test(); 33 SyncTest* test = sync_datatype_helper::test();
34 for (int i = 0; i < test->num_clients(); ++i) { 34 for (int i = 0; i < test->num_clients(); ++i) {
35 if (sync_service_->profile() != test->GetProfile(i)) { 35 if (sync_service_->profile() != test->GetProfile(i))
36 content::NotificationService::current()->Notify( 36 test->TriggerSyncForModelTypes(i, model_types);
37 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
38 content::Source<Profile>(test->GetProfile(i)),
39 content::Details<const syncer::ModelTypeSet>(&model_types));
40 }
41 } 37 }
42 } 38 }
43 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698