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/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 TEST_F(ResourceSchedulerTest, NonHTTPSchedulesImmediately) { | 458 TEST_F(ResourceSchedulerTest, NonHTTPSchedulesImmediately) { |
459 // Dummies to enforce scheduling. | 459 // Dummies to enforce scheduling. |
460 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST)); | 460 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST)); |
461 scoped_ptr<TestRequest> low(NewRequest("http://host/high", net::LOWEST)); | 461 scoped_ptr<TestRequest> low(NewRequest("http://host/high", net::LOWEST)); |
462 | 462 |
463 scoped_ptr<TestRequest> request( | 463 scoped_ptr<TestRequest> request( |
464 NewRequest("chrome-extension://req", net::LOWEST)); | 464 NewRequest("chrome-extension://req", net::LOWEST)); |
465 EXPECT_TRUE(request->started()); | 465 EXPECT_TRUE(request->started()); |
466 } | 466 } |
467 | 467 |
| 468 TEST_F(ResourceSchedulerTest, SpdyProxySchedulesImmediately) { |
| 469 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST)); |
| 470 scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOWEST)); |
| 471 |
| 472 scoped_ptr<TestRequest> request(NewRequest("http://host/req", net::IDLE)); |
| 473 EXPECT_FALSE(request->started()); |
| 474 |
| 475 scheduler_.OnReceivedSpdyProxiedHttpResponse(kChildId, kRouteId); |
| 476 EXPECT_TRUE(request->started()); |
| 477 |
| 478 scoped_ptr<TestRequest> after(NewRequest("http://host/after", net::IDLE)); |
| 479 EXPECT_TRUE(after->started()); |
| 480 } |
| 481 |
468 } // unnamed namespace | 482 } // unnamed namespace |
469 | 483 |
470 } // namespace content | 484 } // namespace content |
OLD | NEW |