OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/cryptauth/cryptauth_device_manager.h" | 5 #include "components/cryptauth/cryptauth_device_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 client_factory_->RemoveObserver(this); | 376 client_factory_->RemoveObserver(this); |
377 } | 377 } |
378 | 378 |
379 // testing::Test: | 379 // testing::Test: |
380 void SetUp() override { | 380 void SetUp() override { |
381 clock_->SetNow(base::Time::FromDoubleT(kInitialTimeNowSeconds)); | 381 clock_->SetNow(base::Time::FromDoubleT(kInitialTimeNowSeconds)); |
382 | 382 |
383 CryptAuthDeviceManager::RegisterPrefs(pref_service_.registry()); | 383 CryptAuthDeviceManager::RegisterPrefs(pref_service_.registry()); |
384 pref_service_.SetUserPref( | 384 pref_service_.SetUserPref( |
385 prefs::kCryptAuthDeviceSyncIsRecoveringFromFailure, | 385 prefs::kCryptAuthDeviceSyncIsRecoveringFromFailure, |
386 new base::Value(false)); | 386 base::MakeUnique<base::Value>(false)); |
387 pref_service_.SetUserPref(prefs::kCryptAuthDeviceSyncLastSyncTimeSeconds, | 387 pref_service_.SetUserPref( |
388 new base::Value(kLastSyncTimeSeconds)); | 388 prefs::kCryptAuthDeviceSyncLastSyncTimeSeconds, |
389 pref_service_.SetUserPref(prefs::kCryptAuthDeviceSyncReason, | 389 base::MakeUnique<base::Value>(kLastSyncTimeSeconds)); |
390 new base::Value(INVOCATION_REASON_UNKNOWN)); | 390 pref_service_.SetUserPref( |
| 391 prefs::kCryptAuthDeviceSyncReason, |
| 392 base::MakeUnique<base::Value>(INVOCATION_REASON_UNKNOWN)); |
391 | 393 |
392 std::unique_ptr<base::DictionaryValue> device_dictionary( | 394 std::unique_ptr<base::DictionaryValue> device_dictionary( |
393 new base::DictionaryValue()); | 395 new base::DictionaryValue()); |
394 | 396 |
395 std::string public_key_b64, device_name_b64, bluetooth_address_b64; | 397 std::string public_key_b64, device_name_b64, bluetooth_address_b64; |
396 base::Base64UrlEncode(kStoredPublicKey, | 398 base::Base64UrlEncode(kStoredPublicKey, |
397 base::Base64UrlEncodePolicy::INCLUDE_PADDING, | 399 base::Base64UrlEncodePolicy::INCLUDE_PADDING, |
398 &public_key_b64); | 400 &public_key_b64); |
399 base::Base64UrlEncode(kStoredDeviceName, | 401 base::Base64UrlEncode(kStoredDeviceName, |
400 base::Base64UrlEncodePolicy::INCLUDE_PADDING, | 402 base::Base64UrlEncodePolicy::INCLUDE_PADDING, |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 std::vector<ExternalDeviceInfo>(1, devices_in_response_[0]), | 900 std::vector<ExternalDeviceInfo>(1, devices_in_response_[0]), |
899 device_manager_->GetUnlockKeys()); | 901 device_manager_->GetUnlockKeys()); |
900 | 902 |
901 // Only tether hosts. | 903 // Only tether hosts. |
902 ExpectSyncedDevicesAreEqual( | 904 ExpectSyncedDevicesAreEqual( |
903 std::vector<ExternalDeviceInfo>(1, devices_in_response_[0]), | 905 std::vector<ExternalDeviceInfo>(1, devices_in_response_[0]), |
904 device_manager_->GetTetherHosts()); | 906 device_manager_->GetTetherHosts()); |
905 } | 907 } |
906 | 908 |
907 } // namespace cryptauth | 909 } // namespace cryptauth |
OLD | NEW |