OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/rate_limiter.h" | 5 #include "components/policy/core/common/cloud/rate_limiter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/test/simple_test_tick_clock.h" | 9 #include "base/test/simple_test_tick_clock.h" |
10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
11 #include "base/time/tick_clock.h" | 11 #include "base/time/tick_clock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace policy { | 14 namespace policy { |
15 | 15 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // Now advance time beyond the initial duration. It will immediately execute | 113 // Now advance time beyond the initial duration. It will immediately execute |
114 // the callback. | 114 // the callback. |
115 EXPECT_EQ(max_requests_, callbacks_); | 115 EXPECT_EQ(max_requests_, callbacks_); |
116 task_runner_->RunPendingTasks(); | 116 task_runner_->RunPendingTasks(); |
117 EXPECT_TRUE(task_runner_->GetPendingTasks().empty()); | 117 EXPECT_TRUE(task_runner_->GetPendingTasks().empty()); |
118 EXPECT_EQ(max_requests_ + 1, callbacks_); | 118 EXPECT_EQ(max_requests_ + 1, callbacks_); |
119 } | 119 } |
120 | 120 |
121 } // namespace policy | 121 } // namespace policy |
OLD | NEW |