| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <deque> | 5 #include <deque> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "base/test/test_timeouts.h" | 12 #include "base/test/test_timeouts.h" |
| 13 #include "chrome/browser/browsing_data_remover.h" | 13 #include "chrome/browser/browsing_data_remover.h" |
| 14 #include "chrome/browser/content_settings/host_content_settings_map.h" | 14 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 15 #include "chrome/browser/favicon/favicon_tab_helper.h" | 15 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
| 17 #include "chrome/browser/prerender/prerender_contents.h" | 17 #include "chrome/browser/prerender/prerender_contents.h" |
| 18 #include "chrome/browser/prerender/prerender_manager.h" | 18 #include "chrome/browser/prerender/prerender_manager.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 21 #include "chrome/browser/task_manager/task_manager.h" | 21 #include "chrome/browser/task_manager/task_manager.h" |
| 22 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 25 #include "chrome/common/chrome_notification_types.h" |
| 25 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/test/in_process_browser_test.h" | 29 #include "chrome/test/in_process_browser_test.h" |
| 29 #include "chrome/test/ui_test_utils.h" | 30 #include "chrome/test/ui_test_utils.h" |
| 30 #include "content/browser/renderer_host/render_view_host.h" | 31 #include "content/browser/renderer_host/render_view_host.h" |
| 31 #include "content/browser/tab_contents/tab_contents.h" | 32 #include "content/browser/tab_contents/tab_contents.h" |
| 32 #include "content/common/notification_service.h" | 33 #include "content/common/notification_service.h" |
| 33 #include "content/common/url_constants.h" | 34 #include "content/common/url_constants.h" |
| 34 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 } | 1454 } |
| 1454 | 1455 |
| 1455 // Checks that the favicon is properly loaded on prerender. | 1456 // Checks that the favicon is properly loaded on prerender. |
| 1456 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) { | 1457 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) { |
| 1457 PrerenderTestURL("files/prerender/prerender_favicon.html", | 1458 PrerenderTestURL("files/prerender/prerender_favicon.html", |
| 1458 FINAL_STATUS_USED, | 1459 FINAL_STATUS_USED, |
| 1459 1); | 1460 1); |
| 1460 TestPrerenderContents* prerender_contents = GetPrerenderContents(); | 1461 TestPrerenderContents* prerender_contents = GetPrerenderContents(); |
| 1461 ASSERT_TRUE(prerender_contents != NULL); | 1462 ASSERT_TRUE(prerender_contents != NULL); |
| 1462 ui_test_utils::WindowedNotificationObserver favicon_update_watcher( | 1463 ui_test_utils::WindowedNotificationObserver favicon_update_watcher( |
| 1463 NotificationType::FAVICON_UPDATED, | 1464 chrome::FAVICON_UPDATED, |
| 1464 Source<TabContents>(prerender_contents->prerender_contents()-> | 1465 Source<TabContents>(prerender_contents->prerender_contents()-> |
| 1465 tab_contents())); | 1466 tab_contents())); |
| 1466 NavigateToDestURL(); | 1467 NavigateToDestURL(); |
| 1467 favicon_update_watcher.Wait(); | 1468 favicon_update_watcher.Wait(); |
| 1468 } | 1469 } |
| 1469 | 1470 |
| 1470 // Checks that when a prerendered page is swapped in to a referring page, the | 1471 // Checks that when a prerendered page is swapped in to a referring page, the |
| 1471 // unload handlers on the referring page are executed. | 1472 // unload handlers on the referring page are executed. |
| 1472 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderUnload) { | 1473 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderUnload) { |
| 1473 set_loader_path("files/prerender/prerender_loader_with_unload.html"); | 1474 set_loader_path("files/prerender/prerender_loader_with_unload.html"); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 NewRunnableFunction(ClearBrowsingData, browser(), | 1511 NewRunnableFunction(ClearBrowsingData, browser(), |
| 1511 BrowsingDataRemover::REMOVE_CACHE)); | 1512 BrowsingDataRemover::REMOVE_CACHE)); |
| 1512 ui_test_utils::RunMessageLoop(); | 1513 ui_test_utils::RunMessageLoop(); |
| 1513 | 1514 |
| 1514 // Make sure prerender history was not cleared. Not a vital behavior, but | 1515 // Make sure prerender history was not cleared. Not a vital behavior, but |
| 1515 // used to compare with PrerenderClearHistory test. | 1516 // used to compare with PrerenderClearHistory test. |
| 1516 EXPECT_EQ(1, GetHistoryLength()); | 1517 EXPECT_EQ(1, GetHistoryLength()); |
| 1517 } | 1518 } |
| 1518 | 1519 |
| 1519 } // namespace prerender | 1520 } // namespace prerender |
| OLD | NEW |