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

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

Issue 658163002: Fixed resource scheduler to not treat non-blocking js as render-blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed line lengths Created 6 years, 2 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
« no previous file with comments | « content/browser/loader/resource_scheduler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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(
334 NewRequest("http://host/lowest", net::LOWEST));
335 EXPECT_TRUE(low->started());
336 EXPECT_TRUE(lowest->started());
337 EXPECT_FALSE(lowest2->started());
338 scheduler_.OnWillInsertBody(kChildId, kRouteId);
339 EXPECT_TRUE(lowest2->started());
340 }
341
330 TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInsertedExceptSpdy) { 342 TEST_F(ResourceSchedulerTest, OneLowLoadsUntilBodyInsertedExceptSpdy) {
331 http_server_properties_.SetSupportsSpdy( 343 http_server_properties_.SetSupportsSpdy(
332 net::HostPortPair("spdyhost", 443), true); 344 net::HostPortPair("spdyhost", 443), true);
333 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST)); 345 scoped_ptr<TestRequest> high(NewRequest("http://host/high", net::HIGHEST));
334 scoped_ptr<TestRequest> low_spdy( 346 scoped_ptr<TestRequest> low_spdy(
335 NewRequest("https://spdyhost/low", net::LOWEST)); 347 NewRequest("https://spdyhost/low", net::LOWEST));
336 scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOWEST)); 348 scoped_ptr<TestRequest> low(NewRequest("http://host/low", net::LOWEST));
337 scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST)); 349 scoped_ptr<TestRequest> low2(NewRequest("http://host/low", net::LOWEST));
338 EXPECT_TRUE(high->started()); 350 EXPECT_TRUE(high->started());
339 EXPECT_TRUE(low_spdy->started()); 351 EXPECT_TRUE(low_spdy->started());
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 web_contents_2.reset(); 2203 web_contents_2.reset();
2192 base::RunLoop().RunUntilIdle(); 2204 base::RunLoop().RunUntilIdle();
2193 2205
2194 browser_context.reset(); 2206 browser_context.reset();
2195 render_process_host_factory.reset(); 2207 render_process_host_factory.reset();
2196 } 2208 }
2197 2209
2198 } // unnamed namespace 2210 } // unnamed namespace
2199 2211
2200 } // namespace content 2212 } // namespace content
OLDNEW
« 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