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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // recreate it. This test is useful mainly when it is run under valgrind. Its | 414 // recreate it. This test is useful mainly when it is run under valgrind. Its |
415 // expectations are not very interesting. | 415 // expectations are not very interesting. |
416 TEST_F(ProfileSyncServiceTest, FailToOpenDatabase) { | 416 TEST_F(ProfileSyncServiceTest, FailToOpenDatabase) { |
417 harness_.StartSyncServiceAndSetInitialSyncEnded(false, true, true, true, | 417 harness_.StartSyncServiceAndSetInitialSyncEnded(false, true, true, true, |
418 syncer::STORAGE_INVALID); | 418 syncer::STORAGE_INVALID); |
419 | 419 |
420 // The backend is not ready. Ensure the PSS knows this. | 420 // The backend is not ready. Ensure the PSS knows this. |
421 EXPECT_FALSE(harness_.service->sync_initialized()); | 421 EXPECT_FALSE(harness_.service->sync_initialized()); |
422 } | 422 } |
423 | 423 |
| 424 // This setup will allow the database to exist, but leave it empty. The attempt |
| 425 // to download control types will silently fail (no downloads have any effect in |
| 426 // these tests). The sync_backend_host will notice this and inform the profile |
| 427 // sync service of the failure to initialize the backed. |
| 428 TEST_F(ProfileSyncServiceTest, FailToDownloadControlTypes) { |
| 429 harness_.StartSyncServiceAndSetInitialSyncEnded(false, true, true, true, |
| 430 syncer::STORAGE_IN_MEMORY); |
| 431 |
| 432 // The backend is not ready. Ensure the PSS knows this. |
| 433 EXPECT_FALSE(harness_.service->sync_initialized()); |
| 434 } |
| 435 |
424 // Register a handler with the ProfileSyncService, and disable and | 436 // Register a handler with the ProfileSyncService, and disable and |
425 // reenable sync. The handler should get notified of the state | 437 // reenable sync. The handler should get notified of the state |
426 // changes. | 438 // changes. |
427 // Flaky on all platforms. http://crbug.com/154491 | 439 // Flaky on all platforms. http://crbug.com/154491 |
428 TEST_F(ProfileSyncServiceTest, FLAKY_DisableInvalidationsOnStop) { | 440 TEST_F(ProfileSyncServiceTest, FLAKY_DisableInvalidationsOnStop) { |
429 harness_.StartSyncServiceAndSetInitialSyncEnded( | 441 harness_.StartSyncServiceAndSetInitialSyncEnded( |
430 true, true, true, true, syncer::STORAGE_IN_MEMORY); | 442 true, true, true, true, syncer::STORAGE_IN_MEMORY); |
431 | 443 |
432 syncer::FakeInvalidationHandler handler; | 444 syncer::FakeInvalidationHandler handler; |
433 harness_.service->RegisterInvalidationHandler(&handler); | 445 harness_.service->RegisterInvalidationHandler(&handler); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 namespace syncer { | 609 namespace syncer { |
598 namespace { | 610 namespace { |
599 | 611 |
600 // ProfileSyncService should behave just like an invalidator. | 612 // ProfileSyncService should behave just like an invalidator. |
601 INSTANTIATE_TYPED_TEST_CASE_P( | 613 INSTANTIATE_TYPED_TEST_CASE_P( |
602 ProfileSyncServiceInvalidatorTest, InvalidatorTest, | 614 ProfileSyncServiceInvalidatorTest, InvalidatorTest, |
603 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); | 615 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); |
604 | 616 |
605 } // namespace | 617 } // namespace |
606 } // namespace syncer | 618 } // namespace syncer |
OLD | NEW |