Lines Matching defs:prerender_manager
14 #include "chrome/browser/prerender/prerender_manager.h"
298 UnitTestPrerenderManager* prerender_manager() {
307 prerender_manager()->mutable_config().max_link_concurrency_per_launcher =
309 prerender_manager()->mutable_config().max_link_concurrency =
310 std::max(prerender_manager()->mutable_config().max_link_concurrency,
361 prerender_manager()->CreateNextPrerenderContents(
366 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
376 prerender_manager()->CreateNextPrerenderContents(
381 EXPECT_EQ(null, prerender_manager()->next_prerender_contents());
385 prerender_manager()->CreateNextPrerenderContents(
390 prerender_manager()->next_prerender_contents());
393 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
400 prerender_manager()->CreateNextPrerenderContents(
405 EXPECT_EQ(null, prerender_manager()->next_prerender_contents());
407 prerender_manager()->AdvanceTimeTicks(
408 prerender_manager()->config().time_to_live + TimeDelta::FromSeconds(1));
409 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
417 prerender_manager()->CreateNextPrerenderContents(
424 EXPECT_EQ(null, prerender_manager()->FindEntry(url));
436 prerender_manager()->mutable_config().time_to_live = time_to_live;
437 prerender_manager()->mutable_config().abandon_time_to_live =
442 prerender_manager()->CreateNextPrerenderContents(url,
447 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
450 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
452 EXPECT_EQ(null, prerender_manager()->next_prerender_contents());
453 prerender_manager()->AdvanceTimeTicks(test_advance);
455 EXPECT_EQ(null, prerender_manager()->FindEntry(url));
474 prerender_manager()->mutable_config().time_to_live = time_to_live;
475 prerender_manager()->mutable_config().abandon_time_to_live =
480 prerender_manager()->CreateNextPrerenderContents(url,
485 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
487 prerender_manager()->AdvanceTimeTicks(first_advance);
488 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
492 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
495 EXPECT_EQ(null, prerender_manager()->next_prerender_contents());
497 prerender_manager()->AdvanceTimeTicks(second_advance);
498 EXPECT_EQ(null, prerender_manager()->FindEntry(url));
512 { prerender_manager()->config().max_link_concurrency,
513 prerender_manager()->config().max_link_concurrency_per_launcher},
528 prerender_manager()->mutable_config().max_link_concurrency =
530 prerender_manager()->mutable_config().max_link_concurrency_per_launcher =
545 prerender_manager()->CreateNextPrerenderContents(urls.back(),
548 EXPECT_EQ(null, prerender_manager()->next_prerender_contents());
573 prerender_manager()->CreateNextPrerenderContents(url_to_delay,
577 EXPECT_NE(null, prerender_manager()->next_prerender_contents());
578 EXPECT_EQ(null, prerender_manager()->FindEntry(url_to_delay));
581 prerender_manager()->FindAndUseEntry(urls[j]));
586 prerender_manager()->FindAndUseEntry(url_to_delay));
587 EXPECT_EQ(null, prerender_manager()->next_prerender_contents());
604 prerender_manager()->CreateNextPrerenderContents(
607 ASSERT_EQ(NULL, prerender_manager()->FindEntry(not_an_alias_url));
609 prerender_manager()->FindAndUseEntry(alias_url1));
610 prerender_contents = prerender_manager()->CreateNextPrerenderContents(
614 prerender_manager()->FindAndUseEntry(alias_url2));
615 prerender_contents = prerender_manager()->CreateNextPrerenderContents(
618 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
621 prerender_contents = prerender_manager()->CreateNextPrerenderContents(
627 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
633 prerender_manager()->CreateNextPrerenderContents(
646 prerender_manager()->CreateNextPrerenderContents(
651 prerender_manager()->AddPrerenderFromLinkRelPrerender(
658 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
662 prerender_manager()->FindAndUseEntry(pending_url));
669 prerender_manager()->CreateNextPrerenderContents(
683 prerender_manager()->CreateNextPrerenderContents(
688 prerender_manager()->AddPrerenderFromLinkRelPrerender(
695 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
703 prerender_manager()->CreateNextPrerenderContents(
716 prerender_manager()->AddPrerenderFromLinkRelPrerender(
726 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
737 prerender_manager()->CreateNextPrerenderContents(
749 prerender_manager()->CreateNextPrerenderContents(
762 prerender_manager()->RecordNavigation(url);
765 prerender_manager()->CreateNextPrerenderContents(
774 prerender_manager()->RecordNavigation(url);
775 prerender_manager()->AdvanceTimeTicks(
780 prerender_manager()->CreateNextPrerenderContents(
784 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
791 prerender_manager()->CreateNextPrerenderContents(
798 prerender_manager()->CreateNextPrerenderContents(url,
805 ASSERT_EQ(pplt_dummy_contents, prerender_manager()->FindAndUseEntry(url));
814 prerender_manager()->CreateNextPrerenderContents(
820 prerender_manager()->CreateNextPrerenderContents(url,
822 prerender_manager()->RecordNavigation(url);
826 ASSERT_EQ(pplt_dummy_contents, prerender_manager()->FindAndUseEntry(url));
832 prerender_manager()->CreateNextPrerenderContents(
838 prerender_manager()->CreateNextPrerenderContents(url,
840 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
842 ASSERT_EQ(duplicate_prerender_contents, prerender_manager()->FindEntry(url));
849 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
857 prerender_manager()->CreateNextPrerenderContents(fragment_url,
862 prerender_manager()->FindAndUseEntry(fragment_url));
872 prerender_manager()->CreateNextPrerenderContents(fragment_url,
878 ASSERT_EQ(null, prerender_manager()->FindEntry(other_fragment_url));
881 prerender_manager()->FindAndUseEntry(fragment_url));
888 prerender_manager()->CreateNextPrerenderContents(
893 prerender_manager()->ClearData(PrerenderManager::CLEAR_PRERENDER_CONTENTS);
895 EXPECT_EQ(null, prerender_manager()->FindEntry(url));
902 prerender_manager()->CreateNextPrerenderContents(
906 prerender_manager()->CancelAllPrerenders();
908 EXPECT_EQ(null, prerender_manager()->FindEntry(url));
912 prerender_manager()->set_enabled(false);
913 EXPECT_FALSE(prerender_manager()->AddPrerenderFromOmnibox(
918 prerender_manager()->set_enabled(false);
927 prerender_manager()->CreateNextPrerenderContents(
934 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
941 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
949 prerender_manager()->CreateNextPrerenderContents(
956 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
969 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
976 prerender_manager()->CreateNextPrerenderContents(
983 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
989 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
996 prerender_manager()->CreateNextPrerenderContents(
1003 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1009 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1016 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1023 prerender_manager()->CreateNextPrerenderContents(
1029 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1036 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1046 prerender_manager()->CreateNextPrerenderContents(
1054 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1060 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1065 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1072 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1080 prerender_manager()->CreateNextPrerenderContents(
1088 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1094 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1099 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1116 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1126 prerender_manager()->CreateNextPrerenderContents(
1134 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1140 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1145 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1150 ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url));
1162 prerender_manager()->CreateNextPrerenderContents(
1169 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1170 prerender_manager()->AdvanceTimeTicks(
1171 prerender_manager()->config().time_to_live + TimeDelta::FromSeconds(1));
1175 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1180 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1187 prerender_manager()->CreateNextPrerenderContents(
1193 prerender_manager()->FindEntry(url));
1194 prerender_manager()->AdvanceTimeTicks(
1195 prerender_manager()->config().time_to_live + TimeDelta::FromSeconds(1));
1197 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1199 prerender_manager()->CreateNextPrerenderContents(
1204 prerender_manager()->FindAndUseEntry(url));
1211 prerender_manager()->CreateNextPrerenderContents(
1216 prerender_manager()->FindEntry(url));
1222 ASSERT_EQ(null, prerender_manager()->FindEntry(url));
1224 prerender_manager()->CreateNextPrerenderContents(
1229 prerender_manager()->FindAndUseEntry(url));
1236 prerender_manager()->CreateNextPrerenderContents(
1242 ASSERT_EQ(prerender_contents, prerender_manager()->FindEntry(url));
1246 prerender_manager()->AdvanceTimeTicks(
1247 prerender_manager()->config().abandon_time_to_live +
1251 EXPECT_EQ(null, prerender_manager()->FindEntry(url));
1260 ASSERT_LT(prerender_manager()->config().abandon_time_to_live,
1261 prerender_manager()->config().time_to_live);
1264 prerender_manager()->CreateNextPrerenderContents(
1276 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(first_url));
1277 EXPECT_EQ(null, prerender_manager()->FindEntry(second_url));
1284 prerender_manager()->AdvanceTimeTicks(
1285 prerender_manager()->config().abandon_time_to_live +
1287 EXPECT_EQ(null, prerender_manager()->FindEntry(first_url));
1288 EXPECT_EQ(null, prerender_manager()->FindEntry(second_url));
1297 ASSERT_LT(prerender_manager()->config().abandon_time_to_live,
1298 prerender_manager()->config().time_to_live);
1301 prerender_manager()->CreateNextPrerenderContents(
1321 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(first_url));
1322 EXPECT_EQ(null, prerender_manager()->FindEntry(pending_url));
1329 prerender_manager()->AdvanceTimeTicks(
1330 prerender_manager()->config().abandon_time_to_live +
1332 EXPECT_EQ(null, prerender_manager()->FindEntry(first_url));
1333 EXPECT_EQ(null, prerender_manager()->FindEntry(pending_url));
1342 ASSERT_LT(prerender_manager()->config().max_wait_to_launch,
1343 prerender_manager()->config().time_to_live);
1346 prerender_manager()->CreateNextPrerenderContents(
1356 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(first_url));
1357 EXPECT_EQ(null, prerender_manager()->FindEntry(second_url));
1359 prerender_manager()->AdvanceTimeTicks(
1360 prerender_manager()->config().max_wait_to_launch +
1362 EXPECT_EQ(prerender_contents, prerender_manager()->FindEntry(first_url));
1363 EXPECT_EQ(null, prerender_manager()->FindEntry(second_url));
1366 prerender_manager()->FindAndUseEntry(first_url));
1368 EXPECT_EQ(null, prerender_manager()->FindEntry(first_url));
1369 EXPECT_EQ(null, prerender_manager()->FindEntry(second_url));
1376 ASSERT_LT(prerender_manager()->config().max_wait_to_launch,
1377 prerender_manager()->config().time_to_live);
1381 prerender_manager()->CreateNextPrerenderContents(
1385 prerender_manager()->FindEntry(first_url));
1390 prerender_manager()->config().time_to_live -
1391 prerender_manager()->config().max_wait_to_launch +
1394 prerender_manager()->config().time_to_live -
1397 ASSERT_LT(prerender_manager()->config().time_to_live,
1400 ASSERT_GT(prerender_manager()->config().max_wait_to_launch.InSeconds(),
1403 prerender_manager()->AdvanceTimeTicks(wait_to_launch_second_prerender);
1406 prerender_manager()->CreateNextPrerenderContents(
1412 prerender_manager()->FindEntry(first_url));
1414 EXPECT_EQ(null, prerender_manager()->FindEntry(second_url));
1417 prerender_manager()->AdvanceTimeTicks(wait_for_first_prerender_to_expire);
1418 EXPECT_EQ(null, prerender_manager()->FindEntry(first_url));
1420 prerender_manager()->FindAndUseEntry(second_url));