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

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

Issue 10803026: Get content_browsertest working. I've added a simple test for now, and will convert the tests in sr… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: get it working on mac + linux, fix unittests crash, and fix unittest link error and add missing dep… Created 8 years, 5 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 | Annotate | Revision Log
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 <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/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 30 matching lines...) Expand all
41 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
42 #include "chrome/test/base/in_process_browser_test.h" 42 #include "chrome/test/base/in_process_browser_test.h"
43 #include "chrome/test/base/ui_test_utils.h" 43 #include "chrome/test/base/ui_test_utils.h"
44 #include "content/public/browser/devtools_agent_host_registry.h" 44 #include "content/public/browser/devtools_agent_host_registry.h"
45 #include "content/public/browser/devtools_client_host.h" 45 #include "content/public/browser/devtools_client_host.h"
46 #include "content/public/browser/devtools_manager.h" 46 #include "content/public/browser/devtools_manager.h"
47 #include "content/public/browser/notification_service.h" 47 #include "content/public/browser/notification_service.h"
48 #include "content/public/browser/render_view_host.h" 48 #include "content/public/browser/render_view_host.h"
49 #include "content/public/browser/web_contents.h" 49 #include "content/public/browser/web_contents.h"
50 #include "content/public/common/url_constants.h" 50 #include "content/public/common/url_constants.h"
51 #include "content/public/test/browser_test_utils.h"
51 #include "content/public/test/test_navigation_observer.h" 52 #include "content/public/test/test_navigation_observer.h"
52 #include "grit/generated_resources.h" 53 #include "grit/generated_resources.h"
53 #include "net/base/mock_host_resolver.h" 54 #include "net/base/mock_host_resolver.h"
54 #include "net/url_request/url_request_context.h" 55 #include "net/url_request/url_request_context.h"
55 #include "net/url_request/url_request_context_getter.h" 56 #include "net/url_request/url_request_context_getter.h"
56 #include "ui/base/l10n/l10n_util.h" 57 #include "ui/base/l10n/l10n_util.h"
57 58
58 using content::BrowserThread; 59 using content::BrowserThread;
59 using content::DevToolsAgentHost; 60 using content::DevToolsAgentHost;
60 using content::DevToolsAgentHostRegistry; 61 using content::DevToolsAgentHostRegistry;
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 if (prerender_contents->quit_message_loop_on_destruction()) { 1013 if (prerender_contents->quit_message_loop_on_destruction()) {
1013 // Run message loop until the prerender contents is destroyed. 1014 // Run message loop until the prerender contents is destroyed.
1014 ui_test_utils::RunMessageLoop(); 1015 ui_test_utils::RunMessageLoop();
1015 } else { 1016 } else {
1016 // We don't expect to pick up a running prerender, so instead 1017 // We don't expect to pick up a running prerender, so instead
1017 // observe one navigation. 1018 // observe one navigation.
1018 content::TestNavigationObserver observer( 1019 content::TestNavigationObserver observer(
1019 content::NotificationService::AllSources(), NULL, 1); 1020 content::NotificationService::AllSources(), NULL, 1);
1020 base::RunLoop run_loop; 1021 base::RunLoop run_loop;
1021 observer.WaitForObservation( 1022 observer.WaitForObservation(
1022 base::Bind(&ui_test_utils::RunThisRunLoop, 1023 base::Bind(&content::RunThisRunLoop,
1023 base::Unretained(&run_loop)), 1024 base::Unretained(&run_loop)),
1024 ui_test_utils::GetQuitTaskForRunLoop(&run_loop)); 1025 content::GetQuitTaskForRunLoop(&run_loop));
1025 } 1026 }
1026 } 1027 }
1027 1028
1028 WaitForLoadPrerenderContentsFactory* prerender_contents_factory_; 1029 WaitForLoadPrerenderContentsFactory* prerender_contents_factory_;
1029 #if defined(ENABLE_SAFE_BROWSING) 1030 #if defined(ENABLE_SAFE_BROWSING)
1030 scoped_ptr<TestSafeBrowsingServiceFactory> safe_browsing_factory_; 1031 scoped_ptr<TestSafeBrowsingServiceFactory> safe_browsing_factory_;
1031 #endif 1032 #endif
1032 GURL dest_url_; 1033 GURL dest_url_;
1033 bool use_https_src_server_; 1034 bool use_https_src_server_;
1034 bool call_javascript_; 1035 bool call_javascript_;
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 ResultCatcher catcher; 2375 ResultCatcher catcher;
2375 2376
2376 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); 2377 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
2377 NavigateToDestURL(); 2378 NavigateToDestURL();
2378 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); 2379 ASSERT_TRUE(IsEmptyPrerenderLinkManager());
2379 2380
2380 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 2381 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
2381 } 2382 }
2382 2383
2383 } // namespace prerender 2384 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698