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

Unified Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 11961030: [Sync] Make SESSIONS an implicit type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index 45cd86e1dd9697499135b2d4295cb744e235a19b..2df76c4f74022fe91f463c5d563eb578fbd6a051 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -32,6 +32,8 @@
using syncer::sessions::SyncSessionSnapshot;
+namespace {
+
// TODO(rsimha): Remove the following lines once crbug.com/91863 is fixed.
// The amount of time for which we wait for a live sync operation to complete.
static const int kLiveSyncOperationTimeoutMs = 45000;
@@ -39,6 +41,20 @@ static const int kLiveSyncOperationTimeoutMs = 45000;
// The amount of time we wait for test cases that verify exponential backoff.
static const int kExponentialBackoffVerificationTimeoutMs = 60000;
+syncer::ModelTypeSet GetUserVisibleTypes() {
+ syncer::ModelTypeSet user_visible_types(syncer::UserTypes());
+ user_visible_types.Remove(syncer::APP_NOTIFICATIONS);
+ user_visible_types.Remove(syncer::APP_SETTINGS);
+ user_visible_types.Remove(syncer::AUTOFILL_PROFILE);
+ user_visible_types.Remove(syncer::EXTENSION_SETTINGS);
+ user_visible_types.Remove(syncer::SEARCH_ENGINES);
+ user_visible_types.Remove(syncer::SESSIONS);
+ user_visible_types.Remove(syncer::HISTORY_DELETE_DIRECTIVES);
+ return user_visible_types;
+}
+
+}
+
// Simple class to implement a timeout using PostDelayedTask. If it is not
// aborted before picked up by a message queue, then it asserts with the message
// provided. This class is not thread safe.
@@ -931,7 +947,6 @@ bool ProfileSyncServiceHarness::DisableSyncForDatatype(
DVLOG(1) << GetClientInfoString(
"DisableSyncForDatatype("
+ std::string(syncer::ModelTypeToString(datatype)) + ")");
-
if (service() == NULL) {
LOG(ERROR) << "DisableSyncForDatatype(): service() is null.";
return false;
@@ -945,7 +960,9 @@ bool ProfileSyncServiceHarness::DisableSyncForDatatype(
return true;
}
+ synced_datatypes.RetainAll(GetUserVisibleTypes());
synced_datatypes.Remove(datatype);
+
service()->OnUserChoseDatatypes(false, synced_datatypes);
if (AwaitFullSyncCompletion("Datatype reconfiguration.")) {
DVLOG(1) << "DisableSyncForDatatype(): Disabled sync for datatype "

Powered by Google App Engine
This is Rietveld 408576698