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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 EXPECT_FALSE(encryption_handler()->EncryptEverythingEnabled()); | 330 EXPECT_FALSE(encryption_handler()->EncryptEverythingEnabled()); |
331 Mock::VerifyAndClearExpectations(observer()); | 331 Mock::VerifyAndClearExpectations(observer()); |
332 } | 332 } |
333 | 333 |
334 protected: | 334 protected: |
335 TestUserShare test_user_share_; | 335 TestUserShare test_user_share_; |
336 FakeEncryptor encryptor_; | 336 FakeEncryptor encryptor_; |
337 scoped_ptr<SyncEncryptionHandlerImpl> encryption_handler_; | 337 scoped_ptr<SyncEncryptionHandlerImpl> encryption_handler_; |
338 StrictMock<SyncEncryptionHandlerObserverMock> observer_; | 338 StrictMock<SyncEncryptionHandlerObserverMock> observer_; |
339 TestIdFactory ids_; | 339 TestIdFactory ids_; |
340 MessageLoop message_loop_; | 340 base::MessageLoop message_loop_; |
341 }; | 341 }; |
342 | 342 |
343 // Verify that the encrypted types are being written to and read from the | 343 // Verify that the encrypted types are being written to and read from the |
344 // nigori node properly. | 344 // nigori node properly. |
345 TEST_F(SyncEncryptionHandlerImplTest, NigoriEncryptionTypes) { | 345 TEST_F(SyncEncryptionHandlerImplTest, NigoriEncryptionTypes) { |
346 sync_pb::NigoriSpecifics nigori; | 346 sync_pb::NigoriSpecifics nigori; |
347 | 347 |
348 StrictMock<SyncEncryptionHandlerObserverMock> observer2; | 348 StrictMock<SyncEncryptionHandlerObserverMock> observer2; |
349 SyncEncryptionHandlerImpl handler2(user_share(), | 349 SyncEncryptionHandlerImpl handler2(user_share(), |
350 &encryptor_, | 350 &encryptor_, |
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2273 encryption_handler()->SetKeystoreKeys(keys, | 2273 encryption_handler()->SetKeystoreKeys(keys, |
2274 trans.GetWrappedTrans()); | 2274 trans.GetWrappedTrans()); |
2275 } | 2275 } |
2276 PumpLoop(); | 2276 PumpLoop(); |
2277 Mock::VerifyAndClearExpectations(observer()); | 2277 Mock::VerifyAndClearExpectations(observer()); |
2278 | 2278 |
2279 VerifyMigratedNigoriWithTimestamp(1, CUSTOM_PASSPHRASE, kCustomPass); | 2279 VerifyMigratedNigoriWithTimestamp(1, CUSTOM_PASSPHRASE, kCustomPass); |
2280 } | 2280 } |
2281 | 2281 |
2282 } // namespace syncer | 2282 } // namespace syncer |
OLD | NEW |