| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <deque> | 6 #include <deque> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 46 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
| 47 #include "chrome/browser/prerender/prerender_manager.h" | 47 #include "chrome/browser/prerender/prerender_manager.h" |
| 48 #include "chrome/browser/prerender/prerender_manager_factory.h" | 48 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 49 #include "chrome/browser/profiles/profile.h" | 49 #include "chrome/browser/profiles/profile.h" |
| 50 #include "chrome/browser/profiles/profile_io_data.h" | 50 #include "chrome/browser/profiles/profile_io_data.h" |
| 51 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" | 51 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
| 52 #include "chrome/browser/safe_browsing/local_database_manager.h" | 52 #include "chrome/browser/safe_browsing/local_database_manager.h" |
| 53 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 53 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 54 #include "chrome/browser/task_management/mock_web_contents_task_manager.h" | 54 #include "chrome/browser/task_management/mock_web_contents_task_manager.h" |
| 55 #include "chrome/browser/task_management/providers/web_contents/web_contents_tag
s_manager.h" | 55 #include "chrome/browser/task_management/providers/web_contents/web_contents_tag
s_manager.h" |
| 56 #include "chrome/browser/task_manager/task_manager.h" | 56 #include "chrome/browser/task_management/task_manager_browsertest_util.h" |
| 57 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | |
| 58 #include "chrome/browser/ui/browser.h" | 57 #include "chrome/browser/ui/browser.h" |
| 59 #include "chrome/browser/ui/browser_commands.h" | 58 #include "chrome/browser/ui/browser_commands.h" |
| 60 #include "chrome/browser/ui/browser_finder.h" | 59 #include "chrome/browser/ui/browser_finder.h" |
| 61 #include "chrome/browser/ui/browser_window.h" | 60 #include "chrome/browser/ui/browser_window.h" |
| 62 #include "chrome/browser/ui/location_bar/location_bar.h" | 61 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 63 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 62 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 64 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 63 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 65 #include "chrome/common/chrome_paths.h" | 64 #include "chrome/common/chrome_paths.h" |
| 66 #include "chrome/common/chrome_switches.h" | 65 #include "chrome/common/chrome_switches.h" |
| 67 #include "chrome/common/pref_names.h" | 66 #include "chrome/common/pref_names.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 using content::RenderFrameHost; | 128 using content::RenderFrameHost; |
| 130 using content::RenderViewHost; | 129 using content::RenderViewHost; |
| 131 using content::RenderWidgetHost; | 130 using content::RenderWidgetHost; |
| 132 using content::TestNavigationObserver; | 131 using content::TestNavigationObserver; |
| 133 using content::WebContents; | 132 using content::WebContents; |
| 134 using content::WebContentsObserver; | 133 using content::WebContentsObserver; |
| 135 using net::NetworkChangeNotifier; | 134 using net::NetworkChangeNotifier; |
| 136 using safe_browsing::LocalSafeBrowsingDatabaseManager; | 135 using safe_browsing::LocalSafeBrowsingDatabaseManager; |
| 137 using safe_browsing::SafeBrowsingService; | 136 using safe_browsing::SafeBrowsingService; |
| 138 using safe_browsing::SBThreatType; | 137 using safe_browsing::SBThreatType; |
| 139 using task_manager::browsertest_util::WaitForTaskManagerRows; | 138 using task_management::browsertest_util::WaitForTaskManagerRows; |
| 140 | 139 |
| 141 // Prerender tests work as follows: | 140 // Prerender tests work as follows: |
| 142 // | 141 // |
| 143 // A page with a prefetch link to the test page is loaded. Once prerendered, | 142 // A page with a prefetch link to the test page is loaded. Once prerendered, |
| 144 // its Javascript function DidPrerenderPass() is called, which returns true if | 143 // its Javascript function DidPrerenderPass() is called, which returns true if |
| 145 // the page behaves as expected when prerendered. | 144 // the page behaves as expected when prerendered. |
| 146 // | 145 // |
| 147 // The prerendered page is then displayed on a tab. The Javascript function | 146 // The prerendered page is then displayed on a tab. The Javascript function |
| 148 // DidDisplayPass() is called, and returns true if the page behaved as it | 147 // DidDisplayPass() is called, and returns true if the page behaved as it |
| 149 // should while being displayed. | 148 // should while being displayed. |
| (...skipping 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4004 browser()->tab_strip_model()->GetActiveWebContents(); | 4003 browser()->tab_strip_model()->GetActiveWebContents(); |
| 4005 bool display_test_result = false; | 4004 bool display_test_result = false; |
| 4006 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, | 4005 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, |
| 4007 "DidDisplayReallyPass()", | 4006 "DidDisplayReallyPass()", |
| 4008 &display_test_result)); | 4007 &display_test_result)); |
| 4009 ASSERT_TRUE(display_test_result); | 4008 ASSERT_TRUE(display_test_result); |
| 4010 } | 4009 } |
| 4011 #endif // !defined(DISABLE_NACL) | 4010 #endif // !defined(DISABLE_NACL) |
| 4012 | 4011 |
| 4013 } // namespace prerender | 4012 } // namespace prerender |
| OLD | NEW |