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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 1411073005: Migrating tests to use EmbeddedTestServer (/content) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 "content/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 base::MessageLoop::current(), 802 base::MessageLoop::current(),
803 runner->QuitClosure(), 803 runner->QuitClosure(),
804 // If this call times out, it means that a child process is not 804 // If this call times out, it means that a child process is not
805 // responding, which is something we should not ignore. The timeout is 805 // responding, which is something we should not ignore. The timeout is
806 // set to be longer than the normal browser test timeout so that it will 806 // set to be longer than the normal browser test timeout so that it will
807 // be prempted by the normal timeout. 807 // be prempted by the normal timeout.
808 TestTimeouts::action_max_timeout()); 808 TestTimeouts::action_max_timeout());
809 runner->Run(); 809 runner->Run();
810 } 810 }
811 811
812 void SetupCrossSiteRedirector( 812 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server) {
813 net::test_server::EmbeddedTestServer* embedded_test_server) {
814 embedded_test_server->RegisterRequestHandler( 813 embedded_test_server->RegisterRequestHandler(
815 base::Bind(&CrossSiteRedirectResponseHandler, 814 base::Bind(&CrossSiteRedirectResponseHandler,
816 embedded_test_server->base_url())); 815 embedded_test_server->base_url()));
817 } 816 }
818 817
819 void WaitForInterstitialAttach(content::WebContents* web_contents) { 818 void WaitForInterstitialAttach(content::WebContents* web_contents) {
820 if (web_contents->ShowingInterstitialPage()) 819 if (web_contents->ShowingInterstitialPage())
821 return; 820 return;
822 scoped_refptr<content::MessageLoopRunner> loop_runner( 821 scoped_refptr<content::MessageLoopRunner> loop_runner(
823 new content::MessageLoopRunner); 822 new content::MessageLoopRunner);
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 void FrameWatcher::WaitFrames(int frames_to_wait) { 1090 void FrameWatcher::WaitFrames(int frames_to_wait) {
1092 if (frames_to_wait <= 0) 1091 if (frames_to_wait <= 0)
1093 return; 1092 return;
1094 base::RunLoop run_loop; 1093 base::RunLoop run_loop;
1095 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); 1094 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure());
1096 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); 1095 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait);
1097 run_loop.Run(); 1096 run_loop.Run();
1098 } 1097 }
1099 1098
1100 } // namespace content 1099 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | content/renderer/browser_render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698