| 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 <map> | 5 #include <map> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 { 2, 1 }, | 610 { 2, 1 }, |
| 611 | 611 |
| 612 // With the per launcher limit higher than system limit, the system limit | 612 // With the per launcher limit higher than system limit, the system limit |
| 613 // should be in effect. | 613 // should be in effect. |
| 614 { 2, 4 }, | 614 { 2, 4 }, |
| 615 }; | 615 }; |
| 616 | 616 |
| 617 DummyPrerenderContents* null = NULL; | 617 DummyPrerenderContents* null = NULL; |
| 618 GURL url_to_delay("http://www.google.com/delayme"); | 618 GURL url_to_delay("http://www.google.com/delayme"); |
| 619 | 619 |
| 620 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(concurrencies_to_test); ++i) { | 620 for (size_t i = 0; i < arraysize(concurrencies_to_test); ++i) { |
| 621 prerender_manager()->mutable_config().max_link_concurrency = | 621 prerender_manager()->mutable_config().max_link_concurrency = |
| 622 concurrencies_to_test[i].max_link_concurrency; | 622 concurrencies_to_test[i].max_link_concurrency; |
| 623 prerender_manager()->mutable_config().max_link_concurrency_per_launcher = | 623 prerender_manager()->mutable_config().max_link_concurrency_per_launcher = |
| 624 concurrencies_to_test[i].max_link_concurrency_per_launcher; | 624 concurrencies_to_test[i].max_link_concurrency_per_launcher; |
| 625 | 625 |
| 626 const size_t effective_max_link_concurrency = | 626 const size_t effective_max_link_concurrency = |
| 627 std::min(concurrencies_to_test[i].max_link_concurrency, | 627 std::min(concurrencies_to_test[i].max_link_concurrency, |
| 628 concurrencies_to_test[i].max_link_concurrency_per_launcher); | 628 concurrencies_to_test[i].max_link_concurrency_per_launcher); |
| 629 | 629 |
| 630 std::vector<GURL> urls; | 630 std::vector<GURL> urls; |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 CHECK(prerender_handle.get()); | 1582 CHECK(prerender_handle.get()); |
| 1583 EXPECT_TRUE(prerender_handle->IsPrerendering()); | 1583 EXPECT_TRUE(prerender_handle->IsPrerendering()); |
| 1584 EXPECT_TRUE(prerender_contents->prerendering_has_started()); | 1584 EXPECT_TRUE(prerender_contents->prerendering_has_started()); |
| 1585 EXPECT_EQ(prerender_contents, prerender_handle->contents()); | 1585 EXPECT_EQ(prerender_contents, prerender_handle->contents()); |
| 1586 EXPECT_EQ(ORIGIN_INSTANT, prerender_handle->contents()->origin()); | 1586 EXPECT_EQ(ORIGIN_INSTANT, prerender_handle->contents()->origin()); |
| 1587 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url)); | 1587 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url)); |
| 1588 EXPECT_FALSE(prerender_handle->IsPrerendering()); | 1588 EXPECT_FALSE(prerender_handle->IsPrerendering()); |
| 1589 } | 1589 } |
| 1590 | 1590 |
| 1591 } // namespace prerender | 1591 } // namespace prerender |
| OLD | NEW |