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/prefs/pref_member.h" | 5 #include "base/prefs/pref_member.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
| 7 #include "base/run_loop.h" |
7 #include "chrome/browser/sync/profile_sync_service.h" | 8 #include "chrome/browser/sync/profile_sync_service.h" |
8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
9 #include "chrome/browser/sync/test/integration/passwords_helper.h" | 10 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 11 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
11 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" | 12 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" |
12 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 13 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
13 #include "chrome/browser/sync/test/integration/sync_test.h" | 14 #include "chrome/browser/sync/test/integration/sync_test.h" |
14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
15 #include "google_apis/gaia/google_service_auth_error.h" | 16 #include "google_apis/gaia/google_service_auth_error.h" |
16 #include "sync/protocol/sync_protocol_error.h" | 17 #include "sync/protocol/sync_protocol_error.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 ASSERT_TRUE(AwaitSyncDisabled(GetSyncService((0)))); | 187 ASSERT_TRUE(AwaitSyncDisabled(GetSyncService((0)))); |
187 ProfileSyncService::Status status; | 188 ProfileSyncService::Status status; |
188 GetSyncService((0))->QueryDetailedSyncStatus(&status); | 189 GetSyncService((0))->QueryDetailedSyncStatus(&status); |
189 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); | 190 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); |
190 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); | 191 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); |
191 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); | 192 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); |
192 ASSERT_EQ(status.sync_protocol_error.error_description, | 193 ASSERT_EQ(status.sync_protocol_error.error_description, |
193 protocol_error.error_description); | 194 protocol_error.error_description); |
194 } | 195 } |
195 | 196 |
196 // TODO(lipalani): Fix the typed_url dtc so this test case can pass. | 197 IN_PROC_BROWSER_TEST_F(LegacySyncErrorTest, DisableDatatypeWhileRunning) { |
197 IN_PROC_BROWSER_TEST_F(LegacySyncErrorTest, | |
198 DISABLED_DisableDatatypeWhileRunning) { | |
199 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 198 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
200 syncer::ModelTypeSet synced_datatypes = | 199 syncer::ModelTypeSet synced_datatypes = |
201 GetSyncService((0))->GetPreferredDataTypes(); | 200 GetSyncService((0))->GetActiveDataTypes(); |
202 ASSERT_TRUE(synced_datatypes.Has(syncer::TYPED_URLS)); | 201 ASSERT_TRUE(synced_datatypes.Has(syncer::TYPED_URLS)); |
| 202 ASSERT_TRUE(synced_datatypes.Has(syncer::SESSIONS)); |
203 GetProfile(0)->GetPrefs()->SetBoolean( | 203 GetProfile(0)->GetPrefs()->SetBoolean( |
204 prefs::kSavingBrowserHistoryDisabled, true); | 204 prefs::kSavingBrowserHistoryDisabled, true); |
205 | 205 |
206 synced_datatypes = GetSyncService((0))->GetPreferredDataTypes(); | 206 // Flush any tasks posted by observers of the pref change. |
| 207 base::RunLoop().RunUntilIdle(); |
| 208 |
| 209 synced_datatypes = GetSyncService((0))->GetActiveDataTypes(); |
207 ASSERT_FALSE(synced_datatypes.Has(syncer::TYPED_URLS)); | 210 ASSERT_FALSE(synced_datatypes.Has(syncer::TYPED_URLS)); |
| 211 ASSERT_FALSE(synced_datatypes.Has(syncer::SESSIONS)); |
208 | 212 |
209 const BookmarkNode* node1 = AddFolder(0, 0, "title1"); | 213 const BookmarkNode* node1 = AddFolder(0, 0, "title1"); |
210 SetTitle(0, node1, "new_title1"); | 214 SetTitle(0, node1, "new_title1"); |
211 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 215 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
212 // TODO(lipalani)" Verify initial sync ended for typed url is false. | 216 // TODO(lipalani)" Verify initial sync ended for typed url is false. |
213 } | 217 } |
214 | 218 |
215 } // namespace | 219 } // namespace |
OLD | NEW |