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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "chrome/browser/sync/engine/apply_updates_command.h" | 10 #include "chrome/browser/sync/engine/apply_updates_command.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 using syncable::Entry; | 30 using syncable::Entry; |
31 using syncable::Id; | 31 using syncable::Id; |
32 using syncable::MutableEntry; | 32 using syncable::MutableEntry; |
33 using syncable::ReadTransaction; | 33 using syncable::ReadTransaction; |
34 using syncable::UNITTEST; | 34 using syncable::UNITTEST; |
35 using syncable::WriteTransaction; | 35 using syncable::WriteTransaction; |
36 | 36 |
37 namespace { | 37 namespace { |
38 sync_pb::EntitySpecifics DefaultBookmarkSpecifics() { | 38 sync_pb::EntitySpecifics DefaultBookmarkSpecifics() { |
39 sync_pb::EntitySpecifics result; | 39 sync_pb::EntitySpecifics result; |
40 AddDefaultExtensionValue(syncable::BOOKMARKS, &result); | 40 AddDefaultFieldValue(syncable::BOOKMARKS, &result); |
41 return result; | 41 return result; |
42 } | 42 } |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 // A test fixture for tests exercising ApplyUpdatesCommand. | 45 // A test fixture for tests exercising ApplyUpdatesCommand. |
46 class ApplyUpdatesCommandTest : public SyncerCommandTest { | 46 class ApplyUpdatesCommandTest : public SyncerCommandTest { |
47 public: | 47 public: |
48 protected: | 48 protected: |
49 ApplyUpdatesCommandTest() : next_revision_(1) {} | 49 ApplyUpdatesCommandTest() : next_revision_(1) {} |
50 virtual ~ApplyUpdatesCommandTest() {} | 50 virtual ~ApplyUpdatesCommandTest() {} |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 ASSERT_TRUE(entry.good()); | 117 ASSERT_TRUE(entry.good()); |
118 entry.Put(syncable::ID, item_id); | 118 entry.Put(syncable::ID, item_id); |
119 entry.Put(syncable::BASE_VERSION, | 119 entry.Put(syncable::BASE_VERSION, |
120 item_id.ServerKnows() ? next_revision_++ : 0); | 120 item_id.ServerKnows() ? next_revision_++ : 0); |
121 entry.Put(syncable::IS_UNSYNCED, true); | 121 entry.Put(syncable::IS_UNSYNCED, true); |
122 entry.Put(syncable::IS_DIR, is_folder); | 122 entry.Put(syncable::IS_DIR, is_folder); |
123 entry.Put(syncable::IS_DEL, false); | 123 entry.Put(syncable::IS_DEL, false); |
124 entry.Put(syncable::PARENT_ID, parent_id); | 124 entry.Put(syncable::PARENT_ID, parent_id); |
125 CHECK(entry.PutPredecessor(predecessor_id)); | 125 CHECK(entry.PutPredecessor(predecessor_id)); |
126 sync_pb::EntitySpecifics default_specifics; | 126 sync_pb::EntitySpecifics default_specifics; |
127 syncable::AddDefaultExtensionValue(model_type, &default_specifics); | 127 syncable::AddDefaultFieldValue(model_type, &default_specifics); |
128 entry.Put(syncable::SPECIFICS, default_specifics); | 128 entry.Put(syncable::SPECIFICS, default_specifics); |
129 if (item_id.ServerKnows()) { | 129 if (item_id.ServerKnows()) { |
130 entry.Put(syncable::SERVER_SPECIFICS, default_specifics); | 130 entry.Put(syncable::SERVER_SPECIFICS, default_specifics); |
131 entry.Put(syncable::SERVER_IS_DIR, is_folder); | 131 entry.Put(syncable::SERVER_IS_DIR, is_folder); |
132 entry.Put(syncable::SERVER_PARENT_ID, parent_id); | 132 entry.Put(syncable::SERVER_PARENT_ID, parent_id); |
133 entry.Put(syncable::SERVER_IS_DEL, false); | 133 entry.Put(syncable::SERVER_IS_DEL, false); |
134 } | 134 } |
135 if (metahandle_out) | 135 if (metahandle_out) |
136 *metahandle_out = entry.Get(syncable::META_HANDLE); | 136 *metahandle_out = entry.Get(syncable::META_HANDLE); |
137 } | 137 } |
(...skipping 25 matching lines...) Expand all Loading... |
163 // the created item. | 163 // the created item. |
164 int64 CreateSyncedItem(const std::string& name, syncable::ModelType | 164 int64 CreateSyncedItem(const std::string& name, syncable::ModelType |
165 model_type, bool is_folder) { | 165 model_type, bool is_folder) { |
166 WriteTransaction trans(FROM_HERE, UNITTEST, directory()); | 166 WriteTransaction trans(FROM_HERE, UNITTEST, directory()); |
167 | 167 |
168 syncable::Id parent_id(id_factory_.root()); | 168 syncable::Id parent_id(id_factory_.root()); |
169 syncable::Id item_id(id_factory_.MakeServer(name)); | 169 syncable::Id item_id(id_factory_.MakeServer(name)); |
170 int64 version = GetNextRevision(); | 170 int64 version = GetNextRevision(); |
171 | 171 |
172 sync_pb::EntitySpecifics default_specifics; | 172 sync_pb::EntitySpecifics default_specifics; |
173 syncable::AddDefaultExtensionValue(model_type, &default_specifics); | 173 syncable::AddDefaultFieldValue(model_type, &default_specifics); |
174 | 174 |
175 MutableEntry entry(&trans, syncable::CREATE, parent_id, name); | 175 MutableEntry entry(&trans, syncable::CREATE, parent_id, name); |
176 if (!entry.good()) { | 176 if (!entry.good()) { |
177 ADD_FAILURE(); | 177 ADD_FAILURE(); |
178 return syncable::kInvalidMetaHandle; | 178 return syncable::kInvalidMetaHandle; |
179 } | 179 } |
180 | 180 |
181 entry.Put(syncable::ID, item_id); | 181 entry.Put(syncable::ID, item_id); |
182 entry.Put(syncable::BASE_VERSION, version); | 182 entry.Put(syncable::BASE_VERSION, version); |
183 entry.Put(syncable::IS_UNSYNCED, false); | 183 entry.Put(syncable::IS_UNSYNCED, false); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } | 531 } |
532 | 532 |
533 browser_sync::KeyParams params = {"localhost", "dummy", "foobar"}; | 533 browser_sync::KeyParams params = {"localhost", "dummy", "foobar"}; |
534 cryptographer->AddKey(params); | 534 cryptographer->AddKey(params); |
535 | 535 |
536 sync_pb::EntitySpecifics specifics; | 536 sync_pb::EntitySpecifics specifics; |
537 sync_pb::PasswordSpecificsData data; | 537 sync_pb::PasswordSpecificsData data; |
538 data.set_origin("http://example.com"); | 538 data.set_origin("http://example.com"); |
539 | 539 |
540 cryptographer->Encrypt(data, | 540 cryptographer->Encrypt(data, |
541 specifics.MutableExtension(sync_pb::password)->mutable_encrypted()); | 541 specifics.mutable_password()->mutable_encrypted()); |
542 CreateUnappliedNewItem("item", specifics, false); | 542 CreateUnappliedNewItem("item", specifics, false); |
543 | 543 |
544 ExpectGroupToChange(apply_updates_command_, GROUP_PASSWORD); | 544 ExpectGroupToChange(apply_updates_command_, GROUP_PASSWORD); |
545 apply_updates_command_.ExecuteImpl(session()); | 545 apply_updates_command_.ExecuteImpl(session()); |
546 | 546 |
547 sessions::StatusController* status = session()->mutable_status_controller(); | 547 sessions::StatusController* status = session()->mutable_status_controller(); |
548 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_PASSWORD); | 548 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_PASSWORD); |
549 ASSERT_TRUE(status->update_progress()); | 549 ASSERT_TRUE(status->update_progress()); |
550 EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) | 550 EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
551 << "All updates should have been attempted"; | 551 << "All updates should have been attempted"; |
552 ASSERT_TRUE(status->conflict_progress()); | 552 ASSERT_TRUE(status->conflict_progress()); |
553 EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) | 553 EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
554 << "No update should be in conflict because they're all decryptable"; | 554 << "No update should be in conflict because they're all decryptable"; |
555 EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) | 555 EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
556 << "The updates that can be decrypted should be applied"; | 556 << "The updates that can be decrypted should be applied"; |
557 } | 557 } |
558 | 558 |
559 TEST_F(ApplyUpdatesCommandTest, UndecryptableData) { | 559 TEST_F(ApplyUpdatesCommandTest, UndecryptableData) { |
560 // Undecryptable updates should not be applied. | 560 // Undecryptable updates should not be applied. |
561 sync_pb::EntitySpecifics encrypted_bookmark; | 561 sync_pb::EntitySpecifics encrypted_bookmark; |
562 encrypted_bookmark.mutable_encrypted(); | 562 encrypted_bookmark.mutable_encrypted(); |
563 AddDefaultExtensionValue(syncable::BOOKMARKS, &encrypted_bookmark); | 563 AddDefaultFieldValue(syncable::BOOKMARKS, &encrypted_bookmark); |
564 string root_server_id = syncable::GetNullId().GetServerId(); | 564 string root_server_id = syncable::GetNullId().GetServerId(); |
565 CreateUnappliedNewItemWithParent("folder", | 565 CreateUnappliedNewItemWithParent("folder", |
566 encrypted_bookmark, | 566 encrypted_bookmark, |
567 root_server_id); | 567 root_server_id); |
568 CreateUnappliedNewItem("item2", encrypted_bookmark, false); | 568 CreateUnappliedNewItem("item2", encrypted_bookmark, false); |
569 sync_pb::EntitySpecifics encrypted_password; | 569 sync_pb::EntitySpecifics encrypted_password; |
570 encrypted_password.MutableExtension(sync_pb::password); | 570 encrypted_password.mutable_password(); |
571 CreateUnappliedNewItem("item3", encrypted_password, false); | 571 CreateUnappliedNewItem("item3", encrypted_password, false); |
572 | 572 |
573 ExpectGroupsToChange(apply_updates_command_, GROUP_UI, GROUP_PASSWORD); | 573 ExpectGroupsToChange(apply_updates_command_, GROUP_UI, GROUP_PASSWORD); |
574 apply_updates_command_.ExecuteImpl(session()); | 574 apply_updates_command_.ExecuteImpl(session()); |
575 | 575 |
576 sessions::StatusController* status = session()->mutable_status_controller(); | 576 sessions::StatusController* status = session()->mutable_status_controller(); |
577 EXPECT_TRUE(status->HasConflictingUpdates()) | 577 EXPECT_TRUE(status->HasConflictingUpdates()) |
578 << "Updates that can't be decrypted should trigger the syncer to have " | 578 << "Updates that can't be decrypted should trigger the syncer to have " |
579 << "conflicting updates."; | 579 << "conflicting updates."; |
580 { | 580 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 sync_pb::PasswordSpecificsData data; | 616 sync_pb::PasswordSpecificsData data; |
617 data.set_origin("http://example.com/1"); | 617 data.set_origin("http://example.com/1"); |
618 { | 618 { |
619 ReadTransaction trans(FROM_HERE, directory()); | 619 ReadTransaction trans(FROM_HERE, directory()); |
620 Cryptographer* cryptographer = directory()->GetCryptographer(&trans); | 620 Cryptographer* cryptographer = directory()->GetCryptographer(&trans); |
621 | 621 |
622 KeyParams params = {"localhost", "dummy", "foobar"}; | 622 KeyParams params = {"localhost", "dummy", "foobar"}; |
623 cryptographer->AddKey(params); | 623 cryptographer->AddKey(params); |
624 | 624 |
625 cryptographer->Encrypt(data, | 625 cryptographer->Encrypt(data, |
626 specifics.MutableExtension(sync_pb::password)->mutable_encrypted()); | 626 specifics.mutable_password()->mutable_encrypted()); |
627 } | 627 } |
628 CreateUnappliedNewItem("item1", specifics, false); | 628 CreateUnappliedNewItem("item1", specifics, false); |
629 } | 629 } |
630 { | 630 { |
631 // Create a new cryptographer, independent of the one in the session. | 631 // Create a new cryptographer, independent of the one in the session. |
632 Cryptographer cryptographer(&encryptor_); | 632 Cryptographer cryptographer(&encryptor_); |
633 KeyParams params = {"localhost", "dummy", "bazqux"}; | 633 KeyParams params = {"localhost", "dummy", "bazqux"}; |
634 cryptographer.AddKey(params); | 634 cryptographer.AddKey(params); |
635 | 635 |
636 sync_pb::EntitySpecifics specifics; | 636 sync_pb::EntitySpecifics specifics; |
637 sync_pb::PasswordSpecificsData data; | 637 sync_pb::PasswordSpecificsData data; |
638 data.set_origin("http://example.com/2"); | 638 data.set_origin("http://example.com/2"); |
639 | 639 |
640 cryptographer.Encrypt(data, | 640 cryptographer.Encrypt(data, |
641 specifics.MutableExtension(sync_pb::password)->mutable_encrypted()); | 641 specifics.mutable_password()->mutable_encrypted()); |
642 CreateUnappliedNewItem("item2", specifics, false); | 642 CreateUnappliedNewItem("item2", specifics, false); |
643 } | 643 } |
644 | 644 |
645 ExpectGroupToChange(apply_updates_command_, GROUP_PASSWORD); | 645 ExpectGroupToChange(apply_updates_command_, GROUP_PASSWORD); |
646 apply_updates_command_.ExecuteImpl(session()); | 646 apply_updates_command_.ExecuteImpl(session()); |
647 | 647 |
648 sessions::StatusController* status = session()->mutable_status_controller(); | 648 sessions::StatusController* status = session()->mutable_status_controller(); |
649 EXPECT_TRUE(status->HasConflictingUpdates()) | 649 EXPECT_TRUE(status->HasConflictingUpdates()) |
650 << "Updates that can't be decrypted should trigger the syncer to have " | 650 << "Updates that can't be decrypted should trigger the syncer to have " |
651 << "conflicting updates."; | 651 << "conflicting updates."; |
(...skipping 26 matching lines...) Expand all Loading... |
678 cryptographer = directory()->GetCryptographer(&trans); | 678 cryptographer = directory()->GetCryptographer(&trans); |
679 EXPECT_TRUE(cryptographer->GetEncryptedTypes().Equals(encrypted_types)); | 679 EXPECT_TRUE(cryptographer->GetEncryptedTypes().Equals(encrypted_types)); |
680 } | 680 } |
681 | 681 |
682 // Nigori node updates should update the Cryptographer. | 682 // Nigori node updates should update the Cryptographer. |
683 Cryptographer other_cryptographer(&encryptor_); | 683 Cryptographer other_cryptographer(&encryptor_); |
684 KeyParams params = {"localhost", "dummy", "foobar"}; | 684 KeyParams params = {"localhost", "dummy", "foobar"}; |
685 other_cryptographer.AddKey(params); | 685 other_cryptographer.AddKey(params); |
686 | 686 |
687 sync_pb::EntitySpecifics specifics; | 687 sync_pb::EntitySpecifics specifics; |
688 sync_pb::NigoriSpecifics* nigori = | 688 sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); |
689 specifics.MutableExtension(sync_pb::nigori); | |
690 other_cryptographer.GetKeys(nigori->mutable_encrypted()); | 689 other_cryptographer.GetKeys(nigori->mutable_encrypted()); |
691 nigori->set_encrypt_bookmarks(true); | 690 nigori->set_encrypt_bookmarks(true); |
692 encrypted_types.Put(syncable::BOOKMARKS); | 691 encrypted_types.Put(syncable::BOOKMARKS); |
693 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), | 692 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), |
694 specifics, true); | 693 specifics, true); |
695 EXPECT_FALSE(cryptographer->has_pending_keys()); | 694 EXPECT_FALSE(cryptographer->has_pending_keys()); |
696 | 695 |
697 ExpectGroupToChange(apply_updates_command_, GROUP_PASSIVE); | 696 ExpectGroupToChange(apply_updates_command_, GROUP_PASSIVE); |
698 apply_updates_command_.ExecuteImpl(session()); | 697 apply_updates_command_.ExecuteImpl(session()); |
699 | 698 |
(...skipping 27 matching lines...) Expand all Loading... |
727 cryptographer = directory()->GetCryptographer(&trans); | 726 cryptographer = directory()->GetCryptographer(&trans); |
728 EXPECT_TRUE(cryptographer->GetEncryptedTypes().Equals(encrypted_types)); | 727 EXPECT_TRUE(cryptographer->GetEncryptedTypes().Equals(encrypted_types)); |
729 } | 728 } |
730 | 729 |
731 // Nigori node updates should update the Cryptographer. | 730 // Nigori node updates should update the Cryptographer. |
732 Cryptographer other_cryptographer(&encryptor_); | 731 Cryptographer other_cryptographer(&encryptor_); |
733 KeyParams params = {"localhost", "dummy", "foobar"}; | 732 KeyParams params = {"localhost", "dummy", "foobar"}; |
734 other_cryptographer.AddKey(params); | 733 other_cryptographer.AddKey(params); |
735 | 734 |
736 sync_pb::EntitySpecifics specifics; | 735 sync_pb::EntitySpecifics specifics; |
737 sync_pb::NigoriSpecifics* nigori = | 736 sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); |
738 specifics.MutableExtension(sync_pb::nigori); | |
739 other_cryptographer.GetKeys(nigori->mutable_encrypted()); | 737 other_cryptographer.GetKeys(nigori->mutable_encrypted()); |
740 nigori->set_encrypt_sessions(true); | 738 nigori->set_encrypt_sessions(true); |
741 nigori->set_encrypt_themes(true); | 739 nigori->set_encrypt_themes(true); |
742 encrypted_types.Put(syncable::SESSIONS); | 740 encrypted_types.Put(syncable::SESSIONS); |
743 encrypted_types.Put(syncable::THEMES); | 741 encrypted_types.Put(syncable::THEMES); |
744 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), | 742 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), |
745 specifics, true); | 743 specifics, true); |
746 EXPECT_FALSE(cryptographer->has_pending_keys()); | 744 EXPECT_FALSE(cryptographer->has_pending_keys()); |
747 | 745 |
748 ExpectGroupToChange(apply_updates_command_, GROUP_PASSIVE); | 746 ExpectGroupToChange(apply_updates_command_, GROUP_PASSIVE); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 // Next five items are children of the root. | 805 // Next five items are children of the root. |
808 for (; i < 2*batch_s; ++i) { | 806 for (; i < 2*batch_s; ++i) { |
809 CreateUnsyncedItem(id_factory_.NewLocalId(), id_factory_.root(), | 807 CreateUnsyncedItem(id_factory_.NewLocalId(), id_factory_.root(), |
810 base::StringPrintf("Item %"PRIuS"", i), false, | 808 base::StringPrintf("Item %"PRIuS"", i), false, |
811 syncable::BOOKMARKS, NULL); | 809 syncable::BOOKMARKS, NULL); |
812 } | 810 } |
813 | 811 |
814 KeyParams params = {"localhost", "dummy", "foobar"}; | 812 KeyParams params = {"localhost", "dummy", "foobar"}; |
815 cryptographer->AddKey(params); | 813 cryptographer->AddKey(params); |
816 sync_pb::EntitySpecifics specifics; | 814 sync_pb::EntitySpecifics specifics; |
817 sync_pb::NigoriSpecifics* nigori = | 815 sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); |
818 specifics.MutableExtension(sync_pb::nigori); | |
819 cryptographer->GetKeys(nigori->mutable_encrypted()); | 816 cryptographer->GetKeys(nigori->mutable_encrypted()); |
820 nigori->set_encrypt_bookmarks(true); | 817 nigori->set_encrypt_bookmarks(true); |
821 encrypted_types.Put(syncable::BOOKMARKS); | 818 encrypted_types.Put(syncable::BOOKMARKS); |
822 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), | 819 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), |
823 specifics, true); | 820 specifics, true); |
824 EXPECT_FALSE(cryptographer->has_pending_keys()); | 821 EXPECT_FALSE(cryptographer->has_pending_keys()); |
825 EXPECT_TRUE(cryptographer->is_ready()); | 822 EXPECT_TRUE(cryptographer->is_ready()); |
826 | 823 |
827 { | 824 { |
828 // Ensure we have unsynced nodes that aren't properly encrypted. | 825 // Ensure we have unsynced nodes that aren't properly encrypted. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 base::StringPrintf("Item %"PRIuS"", i), false, | 944 base::StringPrintf("Item %"PRIuS"", i), false, |
948 syncable::BOOKMARKS, NULL); | 945 syncable::BOOKMARKS, NULL); |
949 } | 946 } |
950 | 947 |
951 // We encrypt with new keys, triggering the local cryptographer to be unready | 948 // We encrypt with new keys, triggering the local cryptographer to be unready |
952 // and unable to decrypt data (once updated). | 949 // and unable to decrypt data (once updated). |
953 Cryptographer other_cryptographer(&encryptor_); | 950 Cryptographer other_cryptographer(&encryptor_); |
954 KeyParams params = {"localhost", "dummy", "foobar"}; | 951 KeyParams params = {"localhost", "dummy", "foobar"}; |
955 other_cryptographer.AddKey(params); | 952 other_cryptographer.AddKey(params); |
956 sync_pb::EntitySpecifics specifics; | 953 sync_pb::EntitySpecifics specifics; |
957 sync_pb::NigoriSpecifics* nigori = | 954 sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); |
958 specifics.MutableExtension(sync_pb::nigori); | |
959 other_cryptographer.GetKeys(nigori->mutable_encrypted()); | 955 other_cryptographer.GetKeys(nigori->mutable_encrypted()); |
960 nigori->set_encrypt_bookmarks(true); | 956 nigori->set_encrypt_bookmarks(true); |
961 encrypted_types.Put(syncable::BOOKMARKS); | 957 encrypted_types.Put(syncable::BOOKMARKS); |
962 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), | 958 CreateUnappliedNewItem(syncable::ModelTypeToRootTag(syncable::NIGORI), |
963 specifics, true); | 959 specifics, true); |
964 EXPECT_FALSE(cryptographer->has_pending_keys()); | 960 EXPECT_FALSE(cryptographer->has_pending_keys()); |
965 | 961 |
966 { | 962 { |
967 // Ensure we have unsynced nodes that aren't properly encrypted. | 963 // Ensure we have unsynced nodes that aren't properly encrypted. |
968 ReadTransaction trans(FROM_HERE, directory()); | 964 ReadTransaction trans(FROM_HERE, directory()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 EXPECT_FALSE(cryptographer->is_ready()); | 998 EXPECT_FALSE(cryptographer->is_ready()); |
1003 EXPECT_TRUE(cryptographer->has_pending_keys()); | 999 EXPECT_TRUE(cryptographer->has_pending_keys()); |
1004 | 1000 |
1005 Syncer::UnsyncedMetaHandles handles; | 1001 Syncer::UnsyncedMetaHandles handles; |
1006 SyncerUtil::GetUnsyncedEntries(&trans, &handles); | 1002 SyncerUtil::GetUnsyncedEntries(&trans, &handles); |
1007 EXPECT_EQ(2*batch_s+1, handles.size()); | 1003 EXPECT_EQ(2*batch_s+1, handles.size()); |
1008 } | 1004 } |
1009 } | 1005 } |
1010 | 1006 |
1011 } // namespace browser_sync | 1007 } // namespace browser_sync |
OLD | NEW |