OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "sync/internal_api/sync_encryption_handler_impl.h" | 5 #include "sync/internal_api/sync_encryption_handler_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void(ModelTypeSet, bool)); // NOLINT | 57 void(ModelTypeSet, bool)); // NOLINT |
58 MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT | 58 MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT |
59 MOCK_METHOD1(OnCryptographerStateChanged, void(Cryptographer*)); // NOLINT | 59 MOCK_METHOD1(OnCryptographerStateChanged, void(Cryptographer*)); // NOLINT |
60 MOCK_METHOD2(OnPassphraseTypeChanged, void(PassphraseType, | 60 MOCK_METHOD2(OnPassphraseTypeChanged, void(PassphraseType, |
61 base::Time)); // NOLINT | 61 base::Time)); // NOLINT |
62 MOCK_METHOD1(OnLocalSetPassphraseEncryption, | 62 MOCK_METHOD1(OnLocalSetPassphraseEncryption, |
63 void(const SyncEncryptionHandler::NigoriState&)); // NOLINT | 63 void(const SyncEncryptionHandler::NigoriState&)); // NOLINT |
64 }; | 64 }; |
65 | 65 |
66 google::protobuf::RepeatedPtrField<google::protobuf::string> | 66 google::protobuf::RepeatedPtrField<google::protobuf::string> |
67 BuildEncryptionKeyProto(std::string encryption_key) { | 67 BuildEncryptionKeyProto(const std::string& encryption_key) { |
68 google::protobuf::RepeatedPtrField<google::protobuf::string> keys; | 68 google::protobuf::RepeatedPtrField<google::protobuf::string> keys; |
69 keys.Add()->assign(encryption_key); | 69 keys.Add()->assign(encryption_key); |
70 return keys; | 70 return keys; |
71 } | 71 } |
72 | 72 |
73 } // namespace | 73 } // namespace |
74 | 74 |
75 class SyncEncryptionHandlerImplTest : public ::testing::Test { | 75 class SyncEncryptionHandlerImplTest : public ::testing::Test { |
76 public: | 76 public: |
77 SyncEncryptionHandlerImplTest() {} | 77 SyncEncryptionHandlerImplTest() {} |
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 { | 2495 { |
2496 ReadTransaction trans(FROM_HERE, user_share()); | 2496 ReadTransaction trans(FROM_HERE, user_share()); |
2497 encryption_handler()->SetKeystoreKeys(BuildEncryptionKeyProto( | 2497 encryption_handler()->SetKeystoreKeys(BuildEncryptionKeyProto( |
2498 kRawKeystoreKey), | 2498 kRawKeystoreKey), |
2499 trans.GetWrappedTrans()); | 2499 trans.GetWrappedTrans()); |
2500 | 2500 |
2501 } | 2501 } |
2502 } | 2502 } |
2503 | 2503 |
2504 } // namespace syncer | 2504 } // namespace syncer |
OLD | NEW |