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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2044613003: Adds unit tests for offline_pages::PrerenderAdapter calling PrerenderManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated DCHECK to ASSERT Created 4 years, 6 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <deque> 6 #include <deque>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 ASSERT_TRUE(embedded_test_server()->Start()); 1127 ASSERT_TRUE(embedded_test_server()->Start());
1128 ChromeResourceDispatcherHostDelegate:: 1128 ChromeResourceDispatcherHostDelegate::
1129 SetExternalProtocolHandlerDelegateForTesting( 1129 SetExternalProtocolHandlerDelegateForTesting(
1130 &external_protocol_handler_delegate_); 1130 &external_protocol_handler_delegate_);
1131 1131
1132 PrerenderManager* prerender_manager = GetPrerenderManager(); 1132 PrerenderManager* prerender_manager = GetPrerenderManager();
1133 ASSERT_TRUE(prerender_manager); 1133 ASSERT_TRUE(prerender_manager);
1134 prerender_manager->mutable_config().rate_limit_enabled = false; 1134 prerender_manager->mutable_config().rate_limit_enabled = false;
1135 ASSERT_TRUE(prerender_contents_factory_ == NULL); 1135 ASSERT_TRUE(prerender_contents_factory_ == NULL);
1136 prerender_contents_factory_ = new TestPrerenderContentsFactory; 1136 prerender_contents_factory_ = new TestPrerenderContentsFactory;
1137 prerender_manager->SetPrerenderContentsFactory(prerender_contents_factory_); 1137 prerender_manager->SetPrerenderContentsFactoryForTest(
1138 prerender_contents_factory_);
1138 ASSERT_TRUE(safe_browsing_factory_->test_safe_browsing_service()); 1139 ASSERT_TRUE(safe_browsing_factory_->test_safe_browsing_service());
1139 } 1140 }
1140 1141
1141 // Convenience function to get the currently active WebContents in 1142 // Convenience function to get the currently active WebContents in
1142 // current_browser(). 1143 // current_browser().
1143 WebContents* GetActiveWebContents() const { 1144 WebContents* GetActiveWebContents() const {
1144 return current_browser()->tab_strip_model()->GetActiveWebContents(); 1145 return current_browser()->tab_strip_model()->GetActiveWebContents();
1145 } 1146 }
1146 1147
1147 // Overload for a single expected final status 1148 // Overload for a single expected final status
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 browser()->tab_strip_model()->GetActiveWebContents(); 3925 browser()->tab_strip_model()->GetActiveWebContents();
3925 bool display_test_result = false; 3926 bool display_test_result = false;
3926 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3927 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3927 "DidDisplayReallyPass()", 3928 "DidDisplayReallyPass()",
3928 &display_test_result)); 3929 &display_test_result));
3929 ASSERT_TRUE(display_test_result); 3930 ASSERT_TRUE(display_test_result);
3930 } 3931 }
3931 #endif // !defined(DISABLE_NACL) 3932 #endif // !defined(DISABLE_NACL)
3932 3933
3933 } // namespace prerender 3934 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/prerender_adapter_unittest.cc ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698