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 "components/drive/job_queue.h" | 5 #include "components/drive/job_queue.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
8 | 10 |
9 namespace drive { | 11 namespace drive { |
10 | 12 |
11 TEST(JobQueueTest, BasicJobQueueOperations) { | 13 TEST(JobQueueTest, BasicJobQueueOperations) { |
12 const size_t kNumMaxConcurrentJobs = 3; | 14 const size_t kNumMaxConcurrentJobs = 3; |
13 const size_t kNumPriorityLevels = 2; | 15 const size_t kNumPriorityLevels = 2; |
14 const size_t kNumMaxBatchJob = 0; | 16 const size_t kNumMaxBatchJob = 0; |
15 const size_t kMaxBatchSize = 0; | 17 const size_t kMaxBatchSize = 0; |
16 enum {HIGH_PRIORITY, LOW_PRIORITY}; | 18 enum {HIGH_PRIORITY, LOW_PRIORITY}; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 191 |
190 EXPECT_EQ(6U, queue.GetNumberOfJobs()); | 192 EXPECT_EQ(6U, queue.GetNumberOfJobs()); |
191 | 193 |
192 // Pop the 5 of 6 jobs. | 194 // Pop the 5 of 6 jobs. |
193 std::vector<JobID> ids; | 195 std::vector<JobID> ids; |
194 queue.PopForRun(LOW_PRIORITY, &ids); | 196 queue.PopForRun(LOW_PRIORITY, &ids); |
195 EXPECT_EQ(5u, ids.size()); | 197 EXPECT_EQ(5u, ids.size()); |
196 } | 198 } |
197 | 199 |
198 } // namespace drive | 200 } // namespace drive |
OLD | NEW |