OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/offline_pages/background/pick_request_task.h" | 5 #include "components/offline_pages/core/background/pick_request_task.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/test/test_simple_task_runner.h" | 11 #include "base/test/test_simple_task_runner.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "components/offline_pages/background/device_conditions.h" | 13 #include "base/time/time.h" |
14 #include "components/offline_pages/background/offliner_policy.h" | 14 #include "components/offline_pages/core/background/device_conditions.h" |
15 #include "components/offline_pages/background/request_coordinator.h" | 15 #include "components/offline_pages/core/background/offliner_policy.h" |
16 #include "components/offline_pages/background/request_coordinator_event_logger.h
" | 16 #include "components/offline_pages/core/background/request_coordinator.h" |
17 #include "components/offline_pages/background/request_notifier.h" | 17 #include "components/offline_pages/core/background/request_coordinator_event_log
ger.h" |
18 #include "components/offline_pages/background/request_queue_in_memory_store.h" | 18 #include "components/offline_pages/core/background/request_notifier.h" |
19 #include "components/offline_pages/background/request_queue_store.h" | 19 #include "components/offline_pages/core/background/request_queue_in_memory_store
.h" |
20 #include "components/offline_pages/background/save_page_request.h" | 20 #include "components/offline_pages/core/background/request_queue_store.h" |
| 21 #include "components/offline_pages/core/background/save_page_request.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
22 | 23 |
23 namespace offline_pages { | 24 namespace offline_pages { |
24 | 25 |
25 namespace { | 26 namespace { |
26 // Data for request 1. | 27 // Data for request 1. |
27 const int64_t kRequestId1 = 17; | 28 const int64_t kRequestId1 = 17; |
28 const GURL kUrl1("https://google.com"); | 29 const GURL kUrl1("https://google.com"); |
29 const ClientId kClientId1("bookmark", "1234"); | 30 const ClientId kClientId1("bookmark", "1234"); |
30 // Data for request 2. | 31 // Data for request 2. |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 PumpLoop(); | 484 PumpLoop(); |
484 | 485 |
485 EXPECT_EQ(kRequestId1, last_picked_->request_id()); | 486 EXPECT_EQ(kRequestId1, last_picked_->request_id()); |
486 EXPECT_FALSE(request_queue_not_picked_called_); | 487 EXPECT_FALSE(request_queue_not_picked_called_); |
487 EXPECT_EQ(2UL, total_request_count_); | 488 EXPECT_EQ(2UL, total_request_count_); |
488 EXPECT_EQ(1UL, available_request_count_); | 489 EXPECT_EQ(1UL, available_request_count_); |
489 EXPECT_TRUE(task_complete_called_); | 490 EXPECT_TRUE(task_complete_called_); |
490 } | 491 } |
491 | 492 |
492 } // namespace offline_pages | 493 } // namespace offline_pages |
OLD | NEW |