| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/loader/resource_scheduler.h" | 5 #include "content/browser/loader/resource_scheduler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" |
| 9 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 11 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/test/mock_entropy_provider.h" | 15 #include "base/test/mock_entropy_provider.h" |
| 15 #include "base/timer/mock_timer.h" | 16 #include "base/timer/mock_timer.h" |
| 16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 17 #include "content/browser/browser_thread_impl.h" | 18 #include "content/browser/browser_thread_impl.h" |
| 18 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 19 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 private: | 123 private: |
| 123 net::HostResolver* GetHostResolver() override { return NULL; } | 124 net::HostResolver* GetHostResolver() override { return NULL; } |
| 124 net::URLRequestContext* GetRequestContext() override { return NULL; } | 125 net::URLRequestContext* GetRequestContext() override { return NULL; } |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 class ResourceSchedulerTest : public testing::Test { | 128 class ResourceSchedulerTest : public testing::Test { |
| 128 protected: | 129 protected: |
| 129 ResourceSchedulerTest() | 130 ResourceSchedulerTest() |
| 130 : ui_thread_(BrowserThread::UI, &message_loop_), | 131 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 131 io_thread_(BrowserThread::IO, &message_loop_), | 132 io_thread_(BrowserThread::IO, &message_loop_), |
| 132 field_trial_list_(new base::MockEntropyProvider()) { | 133 field_trial_list_(base::MakeUnique<base::MockEntropyProvider>()) { |
| 133 InitializeScheduler(); | 134 InitializeScheduler(); |
| 134 context_.set_http_server_properties(&http_server_properties_); | 135 context_.set_http_server_properties(&http_server_properties_); |
| 135 } | 136 } |
| 136 | 137 |
| 137 ~ResourceSchedulerTest() override { | 138 ~ResourceSchedulerTest() override { |
| 138 CleanupScheduler(); | 139 CleanupScheduler(); |
| 139 } | 140 } |
| 140 | 141 |
| 141 // Done separately from construction to allow for modification of command | 142 // Done separately from construction to allow for modification of command |
| 142 // line flags in tests. | 143 // line flags in tests. |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 scheduler_->OnClientDeleted(kChildId2, kRouteId2); | 806 scheduler_->OnClientDeleted(kChildId2, kRouteId2); |
| 806 high.reset(); | 807 high.reset(); |
| 807 delayable_requests.clear(); | 808 delayable_requests.clear(); |
| 808 base::RunLoop().RunUntilIdle(); | 809 base::RunLoop().RunUntilIdle(); |
| 809 EXPECT_TRUE(lowest->started()); | 810 EXPECT_TRUE(lowest->started()); |
| 810 } | 811 } |
| 811 | 812 |
| 812 } // unnamed namespace | 813 } // unnamed namespace |
| 813 | 814 |
| 814 } // namespace content | 815 } // namespace content |
| OLD | NEW |