host_verifier_impl_unittest.cc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/services/multidevice_setup/host_verifier_impl.h"
  5. #include <memory>
  6. #include <string>
  7. #include <utility>
  8. #include "ash/components/multidevice/remote_device_test_util.h"
  9. #include "ash/components/multidevice/software_feature.h"
  10. #include "ash/components/multidevice/software_feature_state.h"
  11. #include "ash/constants/ash_features.h"
  12. #include "ash/services/device_sync/proto/cryptauth_common.pb.h"
  13. #include "ash/services/device_sync/public/cpp/fake_device_sync_client.h"
  14. #include "ash/services/multidevice_setup/fake_host_backend_delegate.h"
  15. #include "ash/services/multidevice_setup/fake_host_verifier.h"
  16. #include "base/test/scoped_feature_list.h"
  17. #include "base/test/simple_test_clock.h"
  18. #include "base/timer/mock_timer.h"
  19. #include "components/sync_preferences/testing_pref_service_syncable.h"
  20. #include "testing/gtest/include/gtest/gtest.h"
  21. namespace ash {
  22. namespace multidevice_setup {
  23. namespace {
  24. // Parameterized test types, indicating the following test scenarios:
  25. enum class TestType {
  26. // Use v1 DeviceSync and host does not have an Instance ID.
  27. kYesV1NoInstanceId,
  28. // Use v1 DeviceSync and host has an Instance ID.
  29. kYesV1YesInstanceId,
  30. // Do not use v1 DeviceSync and host has an Instance ID.
  31. kNoV1YesInstanceId
  32. };
  33. const int64_t kTestTimeMs = 1500000000000;
  34. constexpr const multidevice::SoftwareFeature kPotentialHostSoftwareFeatures[] =
  35. {multidevice::SoftwareFeature::kSmartLockHost,
  36. multidevice::SoftwareFeature::kInstantTetheringHost,
  37. multidevice::SoftwareFeature::kMessagesForWebHost};
  38. const char kRetryTimestampPrefName[] =
  39. "multidevice_setup.current_retry_timestamp_ms";
  40. const char kLastUsedTimeDeltaMsPrefName[] =
  41. "multidevice_setup.last_used_time_delta_ms";
  42. const int64_t kFirstRetryDeltaMs = 10 * 60 * 1000;
  43. const double kExponentialBackoffMultiplier = 1.5;
  44. enum class HostState {
  45. // A device has not been marked as a BetterTogether host.
  46. kHostNotSet,
  47. // A device has been marked as a BetterTogether host, but that device has not
  48. // enabled any of its individual features yet.
  49. kHostSetButFeaturesDisabled,
  50. // A device has been marked as a BetterTogether host, and that device has
  51. // enabled at least one of its individual features.
  52. kHostSetAndFeaturesEnabled
  53. };
  54. } // namespace
  55. class MultiDeviceSetupHostVerifierImplTest
  56. : public ::testing::TestWithParam<TestType> {
  57. public:
  58. MultiDeviceSetupHostVerifierImplTest(
  59. const MultiDeviceSetupHostVerifierImplTest&) = delete;
  60. MultiDeviceSetupHostVerifierImplTest& operator=(
  61. const MultiDeviceSetupHostVerifierImplTest&) = delete;
  62. protected:
  63. MultiDeviceSetupHostVerifierImplTest()
  64. : test_device_(multidevice::CreateRemoteDeviceRefForTest()) {}
  65. ~MultiDeviceSetupHostVerifierImplTest() override = default;
  66. // testing::Test:
  67. void SetUp() override {
  68. SetDeviceSyncFeatureFlags();
  69. if (!HasInstanceId())
  70. GetMutableRemoteDevice(test_device_)->instance_id.clear();
  71. fake_host_backend_delegate_ = std::make_unique<FakeHostBackendDelegate>();
  72. fake_device_sync_client_ =
  73. std::make_unique<device_sync::FakeDeviceSyncClient>();
  74. test_pref_service_ =
  75. std::make_unique<sync_preferences::TestingPrefServiceSyncable>();
  76. HostVerifierImpl::RegisterPrefs(test_pref_service_->registry());
  77. test_clock_ = std::make_unique<base::SimpleTestClock>();
  78. test_clock_->SetNow(base::Time::FromJavaTime(kTestTimeMs));
  79. }
  80. void TearDown() override {
  81. if (fake_observer_)
  82. host_verifier_->RemoveObserver(fake_observer_.get());
  83. }
  84. void CreateVerifier(HostState initial_host_state,
  85. int64_t initial_timer_pref_value = 0,
  86. int64_t initial_time_delta_pref_value = 0) {
  87. SetHostState(initial_host_state);
  88. test_pref_service_->SetInt64(kRetryTimestampPrefName,
  89. initial_timer_pref_value);
  90. test_pref_service_->SetInt64(kLastUsedTimeDeltaMsPrefName,
  91. initial_time_delta_pref_value);
  92. auto mock_retry_timer = std::make_unique<base::MockOneShotTimer>();
  93. mock_retry_timer_ = mock_retry_timer.get();
  94. auto mock_sync_timer = std::make_unique<base::MockOneShotTimer>();
  95. mock_sync_timer_ = mock_sync_timer.get();
  96. host_verifier_ = HostVerifierImpl::Factory::Create(
  97. fake_host_backend_delegate_.get(), fake_device_sync_client_.get(),
  98. test_pref_service_.get(), test_clock_.get(),
  99. std::move(mock_retry_timer), std::move(mock_sync_timer));
  100. fake_observer_ = std::make_unique<FakeHostVerifierObserver>();
  101. host_verifier_->AddObserver(fake_observer_.get());
  102. }
  103. void RemoveTestDeviceCryptoData() {
  104. GetMutableRemoteDevice(test_device_)->public_key.clear();
  105. GetMutableRemoteDevice(test_device_)->beacon_seeds.clear();
  106. GetMutableRemoteDevice(test_device_)->persistent_symmetric_key.clear();
  107. }
  108. void SetHostState(HostState host_state) {
  109. for (const auto& feature : kPotentialHostSoftwareFeatures) {
  110. GetMutableRemoteDevice(test_device_)->software_features[feature] =
  111. host_state == HostState::kHostSetAndFeaturesEnabled
  112. ? multidevice::SoftwareFeatureState::kEnabled
  113. : multidevice::SoftwareFeatureState::kSupported;
  114. }
  115. if (host_state == HostState::kHostNotSet)
  116. fake_host_backend_delegate_->NotifyHostChangedOnBackend(absl::nullopt);
  117. else
  118. fake_host_backend_delegate_->NotifyHostChangedOnBackend(test_device_);
  119. fake_device_sync_client_->NotifyNewDevicesSynced();
  120. }
  121. void VerifyState(bool expected_is_verified,
  122. size_t expected_num_verified_events,
  123. int64_t expected_retry_timestamp_value,
  124. int64_t expected_retry_delta_value) {
  125. EXPECT_EQ(expected_is_verified, host_verifier_->IsHostVerified());
  126. EXPECT_EQ(expected_num_verified_events,
  127. fake_observer_->num_host_verifications());
  128. EXPECT_EQ(expected_retry_timestamp_value,
  129. test_pref_service_->GetInt64(kRetryTimestampPrefName));
  130. EXPECT_EQ(expected_retry_delta_value,
  131. test_pref_service_->GetInt64(kLastUsedTimeDeltaMsPrefName));
  132. // If a retry timestamp is set, the timer should be running.
  133. EXPECT_EQ(expected_retry_timestamp_value != 0,
  134. mock_retry_timer_->IsRunning());
  135. }
  136. void InvokePendingDeviceNotificationCall(bool success) {
  137. if (HasInstanceId()) {
  138. // Verify input parameters to NotifyDevices().
  139. EXPECT_EQ(std::vector<std::string>{test_device_.instance_id()},
  140. fake_device_sync_client_->notify_devices_inputs_queue()
  141. .front()
  142. .device_instance_ids);
  143. EXPECT_EQ(cryptauthv2::TargetService::DEVICE_SYNC,
  144. fake_device_sync_client_->notify_devices_inputs_queue()
  145. .front()
  146. .target_service);
  147. EXPECT_EQ(multidevice::SoftwareFeature::kBetterTogetherHost,
  148. fake_device_sync_client_->notify_devices_inputs_queue()
  149. .front()
  150. .feature);
  151. fake_device_sync_client_->InvokePendingNotifyDevicesCallback(
  152. success
  153. ? device_sync::mojom::NetworkRequestResult::kSuccess
  154. : device_sync::mojom::NetworkRequestResult::kInternalServerError);
  155. } else {
  156. // Verify input parameters to FindEligibleDevices().
  157. EXPECT_EQ(multidevice::SoftwareFeature::kBetterTogetherHost,
  158. fake_device_sync_client_->find_eligible_devices_inputs_queue()
  159. .front()
  160. .software_feature);
  161. fake_device_sync_client_->InvokePendingFindEligibleDevicesCallback(
  162. success
  163. ? device_sync::mojom::NetworkRequestResult::kSuccess
  164. : device_sync::mojom::NetworkRequestResult::kInternalServerError,
  165. multidevice::RemoteDeviceRefList() /* eligible_devices */,
  166. multidevice::RemoteDeviceRefList() /* ineligible_devices */);
  167. }
  168. }
  169. void SimulateRetryTimePassing(const base::TimeDelta& delta,
  170. bool simulate_timeout = false) {
  171. test_clock_->Advance(delta);
  172. if (simulate_timeout)
  173. mock_retry_timer_->Fire();
  174. }
  175. void FireSyncTimerAndVerifySyncOccurred() {
  176. EXPECT_TRUE(mock_sync_timer_->IsRunning());
  177. mock_sync_timer_->Fire();
  178. fake_device_sync_client_->InvokePendingForceSyncNowCallback(
  179. true /* success */);
  180. SetHostState(HostState::kHostSetAndFeaturesEnabled);
  181. }
  182. FakeHostBackendDelegate* fake_host_backend_delegate() {
  183. return fake_host_backend_delegate_.get();
  184. }
  185. private:
  186. bool HasInstanceId() {
  187. switch (GetParam()) {
  188. case TestType::kYesV1YesInstanceId:
  189. [[fallthrough]];
  190. case TestType::kNoV1YesInstanceId:
  191. return true;
  192. case TestType::kYesV1NoInstanceId:
  193. return false;
  194. }
  195. }
  196. void SetDeviceSyncFeatureFlags() {
  197. bool use_v1;
  198. switch (GetParam()) {
  199. case TestType::kYesV1YesInstanceId:
  200. [[fallthrough]];
  201. case TestType::kYesV1NoInstanceId:
  202. use_v1 = true;
  203. break;
  204. case TestType::kNoV1YesInstanceId:
  205. use_v1 = false;
  206. break;
  207. }
  208. std::vector<base::Feature> enabled_features;
  209. std::vector<base::Feature> disabled_features;
  210. // These flags have no direct effect; however, v2 Enrollment and v2
  211. // DeviceSync are prerequisites for disabling v1 DeviceSync.
  212. enabled_features.push_back(chromeos::features::kCryptAuthV2Enrollment);
  213. enabled_features.push_back(chromeos::features::kCryptAuthV2DeviceSync);
  214. if (use_v1) {
  215. disabled_features.push_back(
  216. chromeos::features::kDisableCryptAuthV1DeviceSync);
  217. } else {
  218. enabled_features.push_back(
  219. chromeos::features::kDisableCryptAuthV1DeviceSync);
  220. }
  221. scoped_feature_list_.InitWithFeatures(enabled_features, disabled_features);
  222. }
  223. multidevice::RemoteDeviceRef test_device_;
  224. std::unique_ptr<FakeHostVerifierObserver> fake_observer_;
  225. std::unique_ptr<FakeHostBackendDelegate> fake_host_backend_delegate_;
  226. std::unique_ptr<device_sync::FakeDeviceSyncClient> fake_device_sync_client_;
  227. std::unique_ptr<sync_preferences::TestingPrefServiceSyncable>
  228. test_pref_service_;
  229. std::unique_ptr<base::SimpleTestClock> test_clock_;
  230. base::MockOneShotTimer* mock_retry_timer_ = nullptr;
  231. base::MockOneShotTimer* mock_sync_timer_ = nullptr;
  232. std::unique_ptr<HostVerifier> host_verifier_;
  233. base::test::ScopedFeatureList scoped_feature_list_;
  234. };
  235. TEST_P(MultiDeviceSetupHostVerifierImplTest, StartWithoutHost_SetAndVerify) {
  236. CreateVerifier(HostState::kHostNotSet);
  237. SetHostState(HostState::kHostSetButFeaturesDisabled);
  238. InvokePendingDeviceNotificationCall(true /* success */);
  239. VerifyState(
  240. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  241. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  242. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  243. SimulateRetryTimePassing(base::Minutes(1));
  244. SetHostState(HostState::kHostSetAndFeaturesEnabled);
  245. VerifyState(true /* expected_is_verified */,
  246. 1u /* expected_num_verified_events */,
  247. 0 /* expected_retry_timestamp_value */,
  248. 0 /* expected_retry_delta_value */);
  249. }
  250. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  251. StartWithoutHost_DeviceNotificationFails) {
  252. CreateVerifier(HostState::kHostNotSet);
  253. SetHostState(HostState::kHostSetButFeaturesDisabled);
  254. // If the device notification call fails, a retry should still be scheduled.
  255. InvokePendingDeviceNotificationCall(false /* success */);
  256. VerifyState(
  257. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  258. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  259. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  260. }
  261. TEST_P(MultiDeviceSetupHostVerifierImplTest, SyncAfterDeviceNotification) {
  262. CreateVerifier(HostState::kHostNotSet);
  263. SetHostState(HostState::kHostSetButFeaturesDisabled);
  264. InvokePendingDeviceNotificationCall(true /* success */);
  265. VerifyState(
  266. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  267. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  268. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  269. FireSyncTimerAndVerifySyncOccurred();
  270. VerifyState(true /* expected_is_verified */,
  271. 1u /* expected_num_verified_events */,
  272. 0 /* expected_retry_timestamp_value */,
  273. 0 /* expected_retry_delta_value */);
  274. }
  275. TEST_P(MultiDeviceSetupHostVerifierImplTest, StartWithoutHost_Retry) {
  276. CreateVerifier(HostState::kHostNotSet);
  277. SetHostState(HostState::kHostSetButFeaturesDisabled);
  278. InvokePendingDeviceNotificationCall(true /* success */);
  279. VerifyState(
  280. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  281. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  282. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  283. // Simulate enough time pasing to time out and retry.
  284. SimulateRetryTimePassing(base::Milliseconds(kFirstRetryDeltaMs),
  285. true /* simulate_timeout */);
  286. InvokePendingDeviceNotificationCall(true /* success */);
  287. VerifyState(false /* expected_is_verified */,
  288. 0u /* expected_num_verified_events */,
  289. kTestTimeMs + kFirstRetryDeltaMs +
  290. kFirstRetryDeltaMs * kExponentialBackoffMultiplier
  291. /* expected_retry_timestamp_value */,
  292. kFirstRetryDeltaMs * kExponentialBackoffMultiplier
  293. /* expected_retry_delta_value */);
  294. // Simulate the next retry timeout passing.
  295. SimulateRetryTimePassing(
  296. base::Milliseconds(kFirstRetryDeltaMs * kExponentialBackoffMultiplier),
  297. true /* simulate_timeout */);
  298. InvokePendingDeviceNotificationCall(true /* success */);
  299. VerifyState(false /* expected_is_verified */,
  300. 0u /* expected_num_verified_events */,
  301. kTestTimeMs + kFirstRetryDeltaMs +
  302. kFirstRetryDeltaMs * kExponentialBackoffMultiplier +
  303. kFirstRetryDeltaMs * kExponentialBackoffMultiplier *
  304. kExponentialBackoffMultiplier
  305. /* expected_retry_timestamp_value */,
  306. kFirstRetryDeltaMs * kExponentialBackoffMultiplier *
  307. kExponentialBackoffMultiplier
  308. /* expected_retry_delta_value */);
  309. // Succeed.
  310. SetHostState(HostState::kHostSetAndFeaturesEnabled);
  311. VerifyState(true /* expected_is_verified */,
  312. 1u /* expected_num_verified_events */,
  313. 0 /* expected_retry_timestamp_value */,
  314. 0 /* expected_retry_delta_value */);
  315. }
  316. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  317. StartWithUnverifiedHost_NoInitialPrefs) {
  318. CreateVerifier(HostState::kHostSetButFeaturesDisabled);
  319. InvokePendingDeviceNotificationCall(true /* success */);
  320. VerifyState(
  321. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  322. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  323. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  324. }
  325. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  326. StartWithUnverifiedHost_InitialPrefs_HasNotPassedRetryTime) {
  327. // Simulate starting up the device to find that the retry timer is in 5
  328. // minutes.
  329. CreateVerifier(HostState::kHostSetButFeaturesDisabled,
  330. kTestTimeMs + base::Minutes(5).InMilliseconds()
  331. /* initial_timer_pref_value */,
  332. kFirstRetryDeltaMs /* initial_time_delta_pref_value */);
  333. SimulateRetryTimePassing(base::Minutes(5), true /* simulate_timeout */);
  334. InvokePendingDeviceNotificationCall(true /* success */);
  335. VerifyState(false /* expected_is_verified */,
  336. 0u /* expected_num_verified_events */,
  337. kTestTimeMs + base::Minutes(5).InMilliseconds() +
  338. kFirstRetryDeltaMs * kExponentialBackoffMultiplier
  339. /* expected_retry_timestamp_value */,
  340. kFirstRetryDeltaMs * kExponentialBackoffMultiplier
  341. /* expected_retry_delta_value */);
  342. }
  343. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  344. StartWithUnverifiedHost_InitialPrefs_AlreadyPassedRetryTime) {
  345. // Simulate starting up the device to find that the retry timer had already
  346. // fired 5 minutes ago.
  347. CreateVerifier(HostState::kHostSetButFeaturesDisabled,
  348. kTestTimeMs - base::Minutes(5).InMilliseconds()
  349. /* initial_timer_pref_value */,
  350. kFirstRetryDeltaMs /* initial_time_delta_pref_value */);
  351. InvokePendingDeviceNotificationCall(true /* success */);
  352. VerifyState(false /* expected_is_verified */,
  353. 0u /* expected_num_verified_events */,
  354. kTestTimeMs - base::Minutes(5).InMilliseconds() +
  355. kFirstRetryDeltaMs * kExponentialBackoffMultiplier
  356. /* expected_retry_timestamp_value */,
  357. kFirstRetryDeltaMs * kExponentialBackoffMultiplier
  358. /* expected_retry_delta_value */);
  359. }
  360. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  361. StartWithUnverifiedHost_InitialPrefs_AlreadyPassedMultipleRetryTimes) {
  362. // Simulate starting up the device to find that the retry timer had already
  363. // fired 20 minutes ago.
  364. CreateVerifier(HostState::kHostSetButFeaturesDisabled,
  365. kTestTimeMs - base::Minutes(20).InMilliseconds()
  366. /* initial_timer_pref_value */,
  367. kFirstRetryDeltaMs /* initial_time_delta_pref_value */);
  368. // Because the first delta is 10 minutes, the second delta is 10 * 1.5 = 15
  369. // minutes. In this case, that means that *two* previous timeouts were missed,
  370. // so the third one should be scheduled.
  371. InvokePendingDeviceNotificationCall(true /* success */);
  372. VerifyState(false /* expected_is_verified */,
  373. 0u /* expected_num_verified_events */,
  374. kTestTimeMs - base::Minutes(20).InMilliseconds() +
  375. kFirstRetryDeltaMs * kExponentialBackoffMultiplier +
  376. kFirstRetryDeltaMs * kExponentialBackoffMultiplier *
  377. kExponentialBackoffMultiplier
  378. /* expected_retry_timestamp_value */,
  379. kFirstRetryDeltaMs * kExponentialBackoffMultiplier *
  380. kExponentialBackoffMultiplier
  381. /* expected_retry_delta_value */);
  382. }
  383. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  384. StartWithVerifiedHost_HostChanges) {
  385. CreateVerifier(HostState::kHostSetAndFeaturesEnabled);
  386. VerifyState(true /* expected_is_verified */,
  387. 0u /* expected_num_verified_events */,
  388. 0 /* expected_retry_timestamp_value */,
  389. 0 /* expected_retry_delta_value */);
  390. SetHostState(HostState::kHostNotSet);
  391. VerifyState(false /* expected_is_verified */,
  392. 0u /* expected_num_verified_events */,
  393. 0 /* expected_retry_timestamp_value */,
  394. 0 /* expected_retry_delta_value */);
  395. SetHostState(HostState::kHostSetButFeaturesDisabled);
  396. InvokePendingDeviceNotificationCall(true /* success */);
  397. VerifyState(
  398. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  399. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  400. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  401. }
  402. TEST_P(MultiDeviceSetupHostVerifierImplTest,
  403. StartWithVerifiedHost_PendingRemoval) {
  404. CreateVerifier(HostState::kHostSetAndFeaturesEnabled);
  405. VerifyState(true /* expected_is_verified */,
  406. 0u /* expected_num_verified_events */,
  407. 0 /* expected_retry_timestamp_value */,
  408. 0 /* expected_retry_delta_value */);
  409. fake_host_backend_delegate()->AttemptToSetMultiDeviceHostOnBackend(
  410. absl::nullopt /* host_device */);
  411. VerifyState(false /* expected_is_verified */,
  412. 0u /* expected_num_verified_events */,
  413. 0 /* expected_retry_timestamp_value */,
  414. 0 /* expected_retry_delta_value */);
  415. }
  416. TEST_P(MultiDeviceSetupHostVerifierImplTest, HostMissingCryptoData) {
  417. // Remove the host device's public key, persistent symmetric key, and beacon
  418. // seeds. Without any of these, the host is not considered verified.
  419. RemoveTestDeviceCryptoData();
  420. CreateVerifier(HostState::kHostSetAndFeaturesEnabled);
  421. InvokePendingDeviceNotificationCall(true /* success */);
  422. VerifyState(
  423. false /* expected_is_verified */, 0u /* expected_num_verified_events */,
  424. kTestTimeMs + kFirstRetryDeltaMs /* expected_retry_timestamp_value */,
  425. kFirstRetryDeltaMs /* expected_retry_delta_value */);
  426. }
  427. // Runs tests for the following scenarios.
  428. // - Use v1 DeviceSync and host does not have an Instance ID.
  429. // - Use v1 DeviceSync and host has an Instance ID.
  430. // - Do not use v1 DeviceSync and host has an Instance ID.
  431. // TODO(https://crbug.com/1019206): Remove when v1 DeviceSync is disabled, when
  432. // all devices should have an Instance ID.
  433. INSTANTIATE_TEST_SUITE_P(All,
  434. MultiDeviceSetupHostVerifierImplTest,
  435. ::testing::Values(TestType::kYesV1NoInstanceId,
  436. TestType::kYesV1YesInstanceId,
  437. TestType::kNoV1YesInstanceId));
  438. } // namespace multidevice_setup
  439. } // namespace ash