| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/policy/cloud/cloud_policy_invalidator.h" | 5 #include "chrome/browser/policy/cloud/cloud_policy_invalidator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 bool CloudPolicyInvalidatorTest::InvalidationsEnabled() { | 364 bool CloudPolicyInvalidatorTest::InvalidationsEnabled() { |
| 365 return core_.refresh_scheduler()->invalidations_available(); | 365 return core_.refresh_scheduler()->invalidations_available(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 bool CloudPolicyInvalidatorTest::IsInvalidationAcknowledged( | 368 bool CloudPolicyInvalidatorTest::IsInvalidationAcknowledged( |
| 369 const syncer::Invalidation& invalidation) { | 369 const syncer::Invalidation& invalidation) { |
| 370 // The acknowledgement task is run through a WeakHandle that posts back to our | 370 // The acknowledgement task is run through a WeakHandle that posts back to our |
| 371 // own thread. We need to run any posted tasks before we can check | 371 // own thread. We need to run any posted tasks before we can check |
| 372 // acknowledgement status. | 372 // acknowledgement status. |
| 373 loop_.RunUntilIdle(); | 373 base::RunLoop().RunUntilIdle(); |
| 374 | 374 |
| 375 EXPECT_FALSE(IsUnsent(invalidation)); | 375 EXPECT_FALSE(IsUnsent(invalidation)); |
| 376 return !invalidation_service_.GetMockAckHandler()->IsUnacked(invalidation); | 376 return !invalidation_service_.GetMockAckHandler()->IsUnacked(invalidation); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool CloudPolicyInvalidatorTest::IsInvalidatorRegistered() { | 379 bool CloudPolicyInvalidatorTest::IsInvalidatorRegistered() { |
| 380 return !invalidation_service_.invalidator_registrar() | 380 return !invalidation_service_.invalidator_registrar() |
| 381 .GetRegisteredIds(invalidator_.get()).empty(); | 381 .GetRegisteredIds(invalidator_.get()).empty(); |
| 382 } | 382 } |
| 383 | 383 |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 CloudPolicyInvalidatorUserTypedTest, | 1095 CloudPolicyInvalidatorUserTypedTest, |
| 1096 testing::Values(em::DeviceRegisterRequest::ANDROID_BROWSER)); | 1096 testing::Values(em::DeviceRegisterRequest::ANDROID_BROWSER)); |
| 1097 #else | 1097 #else |
| 1098 INSTANTIATE_TEST_CASE_P( | 1098 INSTANTIATE_TEST_CASE_P( |
| 1099 CloudPolicyInvalidatorUserTypedTestInstance, | 1099 CloudPolicyInvalidatorUserTypedTestInstance, |
| 1100 CloudPolicyInvalidatorUserTypedTest, | 1100 CloudPolicyInvalidatorUserTypedTest, |
| 1101 testing::Values(em::DeviceRegisterRequest::BROWSER)); | 1101 testing::Values(em::DeviceRegisterRequest::BROWSER)); |
| 1102 #endif | 1102 #endif |
| 1103 | 1103 |
| 1104 } // namespace policy | 1104 } // namespace policy |
| OLD | NEW |