Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: content/browser/loader/resource_scheduler_unittest.cc

Issue 12701011: [Net] Propagate priority changes from URLRequest to HttpTransaction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 virtual ~ResourceSchedulerTest() { 86 virtual ~ResourceSchedulerTest() {
87 } 87 }
88 88
89 scoped_ptr<net::URLRequest> NewURLRequest(const char* url, 89 scoped_ptr<net::URLRequest> NewURLRequest(const char* url,
90 net::RequestPriority priority, 90 net::RequestPriority priority,
91 int route_id = kRouteId) { 91 int route_id = kRouteId) {
92 scoped_ptr<net::URLRequest> url_request( 92 scoped_ptr<net::URLRequest> url_request(
93 context_.CreateRequest(GURL(url), NULL)); 93 context_.CreateRequest(GURL(url), NULL));
94 url_request->set_priority(priority); 94 url_request->SetPriority(priority);
95 ResourceRequestInfo::AllocateForTesting( 95 ResourceRequestInfo::AllocateForTesting(
96 url_request.get(), ResourceType::SUB_RESOURCE, NULL, kChildId, 96 url_request.get(), ResourceType::SUB_RESOURCE, NULL, kChildId,
97 route_id); 97 route_id);
98 return url_request.Pass(); 98 return url_request.Pass();
99 } 99 }
100 100
101 TestRequest* NewRequest(const char* url, net::RequestPriority priority, 101 TestRequest* NewRequest(const char* url, net::RequestPriority priority,
102 int route_id = kRouteId) { 102 int route_id = kRouteId) {
103 scoped_ptr<net::URLRequest> url_request( 103 scoped_ptr<net::URLRequest> url_request(
104 NewURLRequest(url, priority, route_id)); 104 NewURLRequest(url, priority, route_id));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 EXPECT_FALSE(low2->started()); 202 EXPECT_FALSE(low2->started());
203 high.reset(); 203 high.reset();
204 EXPECT_TRUE(low1->started()); 204 EXPECT_TRUE(low1->started());
205 EXPECT_TRUE(low2->started()); 205 EXPECT_TRUE(low2->started());
206 EXPECT_TRUE(low4->started()); 206 EXPECT_TRUE(low4->started());
207 } 207 }
208 208
209 } // unnamed namespace 209 } // unnamed namespace
210 210
211 } // namespace content 211 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698