| 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/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/json/json_reader.h" | 15 #include "base/json/json_reader.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/process/kill.h" | 17 #include "base/process/kill.h" |
| 18 #include "base/rand_util.h" | 18 #include "base/rand_util.h" |
| 19 #include "base/strings/pattern.h" | 19 #include "base/strings/pattern.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_piece.h" | 21 #include "base/strings/string_piece.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
| 24 #include "base/test/test_timeouts.h" | 24 #include "base/test/test_timeouts.h" |
| 25 #include "base/threading/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
| 26 #include "base/values.h" | 26 #include "base/values.h" |
| 27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
| 28 #include "cc/surfaces/surface.h" | 28 #include "cc/surfaces/surface.h" |
| 29 #include "cc/surfaces/surface_manager.h" | 29 #include "cc/surfaces/surface_manager.h" |
| 30 #include "content/browser/accessibility/accessibility_mode_helper.h" | |
| 31 #include "content/browser/accessibility/browser_accessibility.h" | 30 #include "content/browser/accessibility/browser_accessibility.h" |
| 32 #include "content/browser/accessibility/browser_accessibility_manager.h" | 31 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 33 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 32 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 34 #include "content/browser/compositor/surface_utils.h" | 33 #include "content/browser/compositor/surface_utils.h" |
| 35 #include "content/browser/frame_host/cross_process_frame_connector.h" | 34 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 36 #include "content/browser/frame_host/frame_tree_node.h" | 35 #include "content/browser/frame_host/frame_tree_node.h" |
| 37 #include "content/browser/frame_host/render_frame_host_impl.h" | 36 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 38 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 39 #include "content/browser/renderer_host/render_widget_host_impl.h" | 38 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 40 #include "content/browser/web_contents/web_contents_impl.h" | 39 #include "content/browser/web_contents/web_contents_impl.h" |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 " checkState();" | 1019 " checkState();" |
| 1021 " document.addEventListener('readystatechange', checkState);" | 1020 " document.addEventListener('readystatechange', checkState);" |
| 1022 "})();", | 1021 "})();", |
| 1023 &result)); | 1022 &result)); |
| 1024 return result == "pageLoadComplete"; | 1023 return result == "pageLoadComplete"; |
| 1025 } | 1024 } |
| 1026 | 1025 |
| 1027 void EnableAccessibilityForWebContents(WebContents* web_contents) { | 1026 void EnableAccessibilityForWebContents(WebContents* web_contents) { |
| 1028 WebContentsImpl* web_contents_impl = | 1027 WebContentsImpl* web_contents_impl = |
| 1029 static_cast<WebContentsImpl*>(web_contents); | 1028 static_cast<WebContentsImpl*>(web_contents); |
| 1030 web_contents_impl->SetAccessibilityMode(AccessibilityModeComplete); | 1029 web_contents_impl->SetAccessibilityMode(ACCESSIBILITY_MODE_COMPLETE); |
| 1031 } | 1030 } |
| 1032 | 1031 |
| 1033 void WaitForAccessibilityFocusChange() { | 1032 void WaitForAccessibilityFocusChange() { |
| 1034 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1033 scoped_refptr<content::MessageLoopRunner> loop_runner( |
| 1035 new content::MessageLoopRunner); | 1034 new content::MessageLoopRunner); |
| 1036 BrowserAccessibilityManager::SetFocusChangeCallbackForTesting( | 1035 BrowserAccessibilityManager::SetFocusChangeCallbackForTesting( |
| 1037 loop_runner->QuitClosure()); | 1036 loop_runner->QuitClosure()); |
| 1038 loop_runner->Run(); | 1037 loop_runner->Run(); |
| 1039 } | 1038 } |
| 1040 | 1039 |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 IPC::IpcSecurityTestUtil::PwnMessageReceived( | 1840 IPC::IpcSecurityTestUtil::PwnMessageReceived( |
| 1842 process->GetChannel(), | 1841 process->GetChannel(), |
| 1843 FileSystemHostMsg_Write(request_id, file_path, blob_uuid, position)); | 1842 FileSystemHostMsg_Write(request_id, file_path, blob_uuid, position)); |
| 1844 | 1843 |
| 1845 // If this started an async operation, wait for it to complete. | 1844 // If this started an async operation, wait for it to complete. |
| 1846 if (waiter.did_start_update()) | 1845 if (waiter.did_start_update()) |
| 1847 waiter.WaitForEndUpdate(); | 1846 waiter.WaitForEndUpdate(); |
| 1848 } | 1847 } |
| 1849 | 1848 |
| 1850 } // namespace content | 1849 } // namespace content |
| OLD | NEW |