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

Unified Diff: content/browser/loader/resource_scheduler_unittest.cc

Issue 462813002: Changed resource scheduler to block until all critical resources actually load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed member initialization order (clang warning) Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/loader/resource_scheduler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_scheduler_unittest.cc
diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc
index ea4fc023fa0fbf6e888d355e25ed6c426c26d9a7..48ea93cac3ef36a7560e4db8f8c26dc35b182a29 100644
--- a/content/browser/loader/resource_scheduler_unittest.cc
+++ b/content/browser/loader/resource_scheduler_unittest.cc
@@ -304,10 +304,24 @@ TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInserted) {
EXPECT_TRUE(high->started());
EXPECT_TRUE(low->started());
EXPECT_FALSE(low2->started());
+ high.reset();
scheduler_.OnWillInsertBody(kChildId, kRouteId);
EXPECT_TRUE(low2->started());
}
+TEST_F(ResourceSchedulerTest, OneLowLoadsUntilCriticalComplete) {
+ scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST));
+ scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOWEST));
+ scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST));
+ EXPECT_TRUE(high->started());
+ EXPECT_TRUE(low->started());
+ EXPECT_FALSE(low2->started());
+ scheduler_.OnWillInsertBody(kChildId, kRouteId);
+ EXPECT_FALSE(low2->started());
+ high.reset();
+ EXPECT_TRUE(low2->started());
+}
+
TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInsertedExceptSpdy) {
http_server_properties_.SetSupportsSpdy(
net::HostPortPair("spdyhost", 443), true);
@@ -321,6 +335,7 @@ TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInsertedExceptSpdy) {
EXPECT_TRUE(low->started());
EXPECT_FALSE(low2->started());
scheduler_.OnWillInsertBody(kChildId, kRouteId);
+ high.reset();
EXPECT_TRUE(low2->started());
}
@@ -461,6 +476,8 @@ TEST_F(ResourceSchedulerTest, RaisePriorityInQueue) {
}
scheduler_.OnWillInsertBody(kChildId, kRouteId);
+ high.reset();
+
EXPECT_TRUE(request->started());
EXPECT_FALSE(idle->started());
}
@@ -490,6 +507,8 @@ TEST_F(ResourceSchedulerTest, LowerPriority) {
}
scheduler_.OnWillInsertBody(kChildId, kRouteId);
+ high.reset();
+
EXPECT_FALSE(request->started());
EXPECT_TRUE(idle->started());
}
@@ -543,6 +562,7 @@ TEST_F(ResourceSchedulerTest, HigherIntraPriorityGoesToFrontOfQueue) {
EXPECT_FALSE(request->started());
scheduler_.OnWillInsertBody(kChildId, kRouteId);
+ high.reset();
EXPECT_TRUE(request->started());
}
« no previous file with comments | « content/browser/loader/resource_scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698