| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |