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 <stddef.h> | 7 #include <stddef.h> |
8 #include <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
17 #include "base/rand_util.h" | 17 #include "base/rand_util.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "base/synchronization/waitable_event.h" | 21 #include "base/synchronization/waitable_event.h" |
22 #include "base/test/test_timeouts.h" | 22 #include "base/test/test_timeouts.h" |
| 23 #include "base/threading/thread_task_runner_handle.h" |
23 #include "base/values.h" | 24 #include "base/values.h" |
24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
25 #include "cc/surfaces/surface.h" | 26 #include "cc/surfaces/surface.h" |
26 #include "cc/surfaces/surface_manager.h" | 27 #include "cc/surfaces/surface_manager.h" |
27 #include "content/browser/accessibility/accessibility_mode_helper.h" | 28 #include "content/browser/accessibility/accessibility_mode_helper.h" |
28 #include "content/browser/accessibility/browser_accessibility.h" | 29 #include "content/browser/accessibility/browser_accessibility.h" |
29 #include "content/browser/accessibility/browser_accessibility_manager.h" | 30 #include "content/browser/accessibility/browser_accessibility_manager.h" |
30 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 31 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
31 #include "content/browser/compositor/surface_utils.h" | 32 #include "content/browser/compositor/surface_utils.h" |
32 #include "content/browser/frame_host/cross_process_frame_connector.h" | 33 #include "content/browser/frame_host/cross_process_frame_connector.h" |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 base::Bind(&SetCookieOnIOThread, url, value, | 975 base::Bind(&SetCookieOnIOThread, url, value, |
975 base::RetainedRef(context_getter), &event, &result)); | 976 base::RetainedRef(context_getter), &event, &result)); |
976 event.Wait(); | 977 event.Wait(); |
977 return result; | 978 return result; |
978 } | 979 } |
979 | 980 |
980 void FetchHistogramsFromChildProcesses() { | 981 void FetchHistogramsFromChildProcesses() { |
981 scoped_refptr<content::MessageLoopRunner> runner = new MessageLoopRunner; | 982 scoped_refptr<content::MessageLoopRunner> runner = new MessageLoopRunner; |
982 | 983 |
983 FetchHistogramsAsynchronously( | 984 FetchHistogramsAsynchronously( |
984 base::MessageLoop::current(), | 985 base::ThreadTaskRunnerHandle::Get(), runner->QuitClosure(), |
985 runner->QuitClosure(), | |
986 // If this call times out, it means that a child process is not | 986 // If this call times out, it means that a child process is not |
987 // responding, which is something we should not ignore. The timeout is | 987 // responding, which is something we should not ignore. The timeout is |
988 // set to be longer than the normal browser test timeout so that it will | 988 // set to be longer than the normal browser test timeout so that it will |
989 // be prempted by the normal timeout. | 989 // be prempted by the normal timeout. |
990 TestTimeouts::action_max_timeout()); | 990 TestTimeouts::action_max_timeout()); |
991 runner->Run(); | 991 runner->Run(); |
992 } | 992 } |
993 | 993 |
994 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server) { | 994 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server) { |
995 embedded_test_server->RegisterRequestHandler( | 995 embedded_test_server->RegisterRequestHandler( |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 | 1771 |
1772 bool TestNavigationManager::ShouldMonitorNavigation(NavigationHandle* handle) { | 1772 bool TestNavigationManager::ShouldMonitorNavigation(NavigationHandle* handle) { |
1773 if (handle_ || handle->GetURL() != url_) | 1773 if (handle_ || handle->GetURL() != url_) |
1774 return false; | 1774 return false; |
1775 if (handled_navigation_) | 1775 if (handled_navigation_) |
1776 return false; | 1776 return false; |
1777 return true; | 1777 return true; |
1778 } | 1778 } |
1779 | 1779 |
1780 } // namespace content | 1780 } // namespace content |
OLD | NEW |