OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 class SyncManagerTest : public testing::Test, | 624 class SyncManagerTest : public testing::Test, |
625 public ModelSafeWorkerRegistrar { | 625 public ModelSafeWorkerRegistrar { |
626 protected: | 626 protected: |
627 SyncManagerTest() : ui_thread_(BrowserThread::UI, &ui_loop_) {} | 627 SyncManagerTest() : ui_thread_(BrowserThread::UI, &ui_loop_) {} |
628 | 628 |
629 // Test implementation. | 629 // Test implementation. |
630 void SetUp() { | 630 void SetUp() { |
631 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 631 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
632 sync_manager_.Init(temp_dir_.path(), "bogus", 0, false, | 632 sync_manager_.Init(temp_dir_.path(), "bogus", 0, false, |
633 new TestHttpPostProviderFactory(), this, "bogus", | 633 new TestHttpPostProviderFactory(), this, "bogus", |
634 SyncCredentials(), notifier::NotifierOptions(), | 634 SyncCredentials(), "", true /* setup_for_test_mode */); |
635 "", true /* setup_for_test_mode */); | |
636 sync_manager_.AddObserver(&observer_); | 635 sync_manager_.AddObserver(&observer_); |
637 ModelSafeRoutingInfo routes; | 636 ModelSafeRoutingInfo routes; |
638 GetModelSafeRoutingInfo(&routes); | 637 GetModelSafeRoutingInfo(&routes); |
639 for (ModelSafeRoutingInfo::iterator i = routes.begin(); i != routes.end(); | 638 for (ModelSafeRoutingInfo::iterator i = routes.begin(); i != routes.end(); |
640 ++i) { | 639 ++i) { |
641 EXPECT_CALL(observer_, OnChangesApplied(i->first, _, _, 1)) | 640 EXPECT_CALL(observer_, OnChangesApplied(i->first, _, _, 1)) |
642 .RetiresOnSaturation(); | 641 .RetiresOnSaturation(); |
643 EXPECT_CALL(observer_, OnChangesComplete(i->first)) | 642 EXPECT_CALL(observer_, OnChangesComplete(i->first)) |
644 .RetiresOnSaturation(); | 643 .RetiresOnSaturation(); |
645 type_roots_[i->first] = MakeServerNodeForType( | 644 type_roots_[i->first] = MakeServerNodeForType( |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 true /* is encrypted */)); | 1054 true /* is encrypted */)); |
1056 EXPECT_TRUE(syncable::VerifyDataTypeEncryption(trans.GetWrappedTrans(), | 1055 EXPECT_TRUE(syncable::VerifyDataTypeEncryption(trans.GetWrappedTrans(), |
1057 syncable::THEMES, | 1056 syncable::THEMES, |
1058 false /* not encrypted */)); | 1057 false /* not encrypted */)); |
1059 } | 1058 } |
1060 } | 1059 } |
1061 | 1060 |
1062 } // namespace | 1061 } // namespace |
1063 | 1062 |
1064 } // namespace browser_sync | 1063 } // namespace browser_sync |
OLD | NEW |