| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 em::DeviceRegisterRequest::Type | 405 em::DeviceRegisterRequest::Type |
| 406 CloudPolicyInvalidatorTest::GetPolicyType() const { | 406 CloudPolicyInvalidatorTest::GetPolicyType() const { |
| 407 return UserCloudPolicyInvalidator::GetPolicyType(); | 407 return UserCloudPolicyInvalidator::GetPolicyType(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 bool CloudPolicyInvalidatorTest::CheckPolicyRefreshed(base::TimeDelta delay) { | 410 bool CloudPolicyInvalidatorTest::CheckPolicyRefreshed(base::TimeDelta delay) { |
| 411 base::TimeDelta max_delay = delay + base::TimeDelta::FromMilliseconds( | 411 base::TimeDelta max_delay = delay + base::TimeDelta::FromMilliseconds( |
| 412 CloudPolicyInvalidator::kMaxFetchDelayMin); | 412 CloudPolicyInvalidator::kMaxFetchDelayMin); |
| 413 | 413 |
| 414 if (task_runner_->GetPendingTasks().empty()) | 414 if (!task_runner_->HasPendingTask()) |
| 415 return false; | 415 return false; |
| 416 base::TimeDelta actual_delay = task_runner_->GetPendingTasks().back().delay; | 416 base::TimeDelta actual_delay = task_runner_->GetPendingTasks().back().delay; |
| 417 EXPECT_GE(actual_delay, delay); | 417 EXPECT_GE(actual_delay, delay); |
| 418 EXPECT_LE(actual_delay, max_delay); | 418 EXPECT_LE(actual_delay, max_delay); |
| 419 | 419 |
| 420 return CheckPolicyRefreshCount(1); | 420 return CheckPolicyRefreshCount(1); |
| 421 } | 421 } |
| 422 | 422 |
| 423 bool CloudPolicyInvalidatorTest::CheckPolicyRefreshCount(int count) { | 423 bool CloudPolicyInvalidatorTest::CheckPolicyRefreshCount(int count) { |
| 424 if (!client_) { | 424 if (!client_) { |
| (...skipping 670 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 |