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/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST)); | 320 scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST)); |
321 EXPECT_TRUE(high->started()); | 321 EXPECT_TRUE(high->started()); |
322 EXPECT_TRUE(low->started()); | 322 EXPECT_TRUE(low->started()); |
323 EXPECT_FALSE(low2->started()); | 323 EXPECT_FALSE(low2->started()); |
324 scheduler_.OnWillInsertBody(kChildId, kRouteId); | 324 scheduler_.OnWillInsertBody(kChildId, kRouteId); |
325 EXPECT_FALSE(low2->started()); | 325 EXPECT_FALSE(low2->started()); |
326 high.reset(); | 326 high.reset(); |
327 EXPECT_TRUE(low2->started()); | 327 EXPECT_TRUE(low2->started()); |
328 } | 328 } |
329 | 329 |
330 TEST_F(ResourceSchedulerTest, LowDoesNotBlockCriticalComplete) { | |
331 scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOW)); | |
332 scoped_ptr<TestRequest> lowest(NewRequest("http://host/lowest", net::LOWEST)); | |
333 scoped_ptr<TestRequest> lowest2(NewRequest("http://host/lowest", net::LOWEST)) ; | |
mmenke
2014/10/16 17:19:42
nit: Fix line length.
Pat Meenan
2014/10/16 18:20:55
Done.
| |
334 EXPECT_TRUE(low->started()); | |
335 EXPECT_TRUE(lowest->started()); | |
336 EXPECT_FALSE(lowest2->started()); | |
337 scheduler_.OnWillInsertBody(kChildId, kRouteId); | |
338 EXPECT_TRUE(lowest2->started()); | |
339 } | |
340 | |
330 TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInsertedExceptSpdy) { | 341 TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInsertedExceptSpdy) { |
331 http_server_properties_.SetSupportsSpdy( | 342 http_server_properties_.SetSupportsSpdy( |
332 net::HostPortPair("spdyhost", 443), true); | 343 net::HostPortPair("spdyhost", 443), true); |
333 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST)); | 344 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST)); |
334 scoped_ptr<TestRequest> low_spdy( | 345 scoped_ptr<TestRequest> low_spdy( |
335 NewRequest("https://spdyhost/low", net::LOWEST)); | 346 NewRequest("https://spdyhost/low", net::LOWEST)); |
336 scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOWEST)); | 347 scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOWEST)); |
337 scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST)); | 348 scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST)); |
338 EXPECT_TRUE(high->started()); | 349 EXPECT_TRUE(high->started()); |
339 EXPECT_TRUE(low_spdy->started()); | 350 EXPECT_TRUE(low_spdy->started()); |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2191 web_contents_2.reset(); | 2202 web_contents_2.reset(); |
2192 base::RunLoop().RunUntilIdle(); | 2203 base::RunLoop().RunUntilIdle(); |
2193 | 2204 |
2194 browser_context.reset(); | 2205 browser_context.reset(); |
2195 render_process_host_factory.reset(); | 2206 render_process_host_factory.reset(); |
2196 } | 2207 } |
2197 | 2208 |
2198 } // unnamed namespace | 2209 } // unnamed namespace |
2199 | 2210 |
2200 } // namespace content | 2211 } // namespace content |
OLD | NEW |