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 "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
9 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 9 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
10 #include "content/browser/loader/resource_request_info_impl.h" | 10 #include "content/browser/loader/resource_request_info_impl.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 virtual ~ResourceSchedulerTest() { | 86 virtual ~ResourceSchedulerTest() { |
87 scheduler_.OnClientDeleted(kChildId, kRouteId); | 87 scheduler_.OnClientDeleted(kChildId, kRouteId); |
88 } | 88 } |
89 | 89 |
90 scoped_ptr<net::URLRequest> NewURLRequest(const char* url, | 90 scoped_ptr<net::URLRequest> NewURLRequest(const char* url, |
91 net::RequestPriority priority, | 91 net::RequestPriority priority, |
92 int route_id = kRouteId) { | 92 int route_id = kRouteId) { |
93 scoped_ptr<net::URLRequest> url_request( | 93 scoped_ptr<net::URLRequest> url_request( |
94 context_.CreateRequest(GURL(url), NULL)); | 94 context_.CreateRequest(GURL(url), NULL)); |
95 url_request->set_priority(priority); | 95 url_request->SetPriority(priority); |
96 ResourceRequestInfo::AllocateForTesting( | 96 ResourceRequestInfo::AllocateForTesting( |
97 url_request.get(), ResourceType::SUB_RESOURCE, NULL, kChildId, | 97 url_request.get(), ResourceType::SUB_RESOURCE, NULL, kChildId, |
98 route_id); | 98 route_id); |
99 return url_request.Pass(); | 99 return url_request.Pass(); |
100 } | 100 } |
101 | 101 |
102 TestRequest* NewRequest(const char* url, net::RequestPriority priority, | 102 TestRequest* NewRequest(const char* url, net::RequestPriority priority, |
103 int route_id = kRouteId) { | 103 int route_id = kRouteId) { |
104 scoped_ptr<net::URLRequest> url_request( | 104 scoped_ptr<net::URLRequest> url_request( |
105 NewURLRequest(url, priority, route_id)); | 105 NewURLRequest(url, priority, route_id)); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 EXPECT_FALSE(low2->started()); | 189 EXPECT_FALSE(low2->started()); |
190 high.reset(); | 190 high.reset(); |
191 EXPECT_TRUE(low1->started()); | 191 EXPECT_TRUE(low1->started()); |
192 EXPECT_TRUE(low2->started()); | 192 EXPECT_TRUE(low2->started()); |
193 EXPECT_TRUE(low4->started()); | 193 EXPECT_TRUE(low4->started()); |
194 } | 194 } |
195 | 195 |
196 } // unnamed namespace | 196 } // unnamed namespace |
197 | 197 |
198 } // namespace content | 198 } // namespace content |
OLD | NEW |