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

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

Issue 2558933002: Add more fine-grained accessibility modes. (Closed)
Patch Set: Rename constants Created 4 years 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 <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/pattern.h" 18 #include "base/strings/pattern.h"
19 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/string_piece.h" 20 #include "base/strings/string_piece.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/synchronization/waitable_event.h" 22 #include "base/synchronization/waitable_event.h"
23 #include "base/test/test_timeouts.h" 23 #include "base/test/test_timeouts.h"
24 #include "base/threading/thread_task_runner_handle.h" 24 #include "base/threading/thread_task_runner_handle.h"
25 #include "base/values.h" 25 #include "base/values.h"
26 #include "build/build_config.h" 26 #include "build/build_config.h"
27 #include "cc/surfaces/surface.h" 27 #include "cc/surfaces/surface.h"
28 #include "cc/surfaces/surface_manager.h" 28 #include "cc/surfaces/surface_manager.h"
29 #include "content/browser/accessibility/accessibility_mode_helper.h"
30 #include "content/browser/accessibility/browser_accessibility.h" 29 #include "content/browser/accessibility/browser_accessibility.h"
31 #include "content/browser/accessibility/browser_accessibility_manager.h" 30 #include "content/browser/accessibility/browser_accessibility_manager.h"
32 #include "content/browser/browser_plugin/browser_plugin_guest.h" 31 #include "content/browser/browser_plugin/browser_plugin_guest.h"
33 #include "content/browser/compositor/surface_utils.h" 32 #include "content/browser/compositor/surface_utils.h"
34 #include "content/browser/frame_host/cross_process_frame_connector.h" 33 #include "content/browser/frame_host/cross_process_frame_connector.h"
35 #include "content/browser/frame_host/frame_tree_node.h" 34 #include "content/browser/frame_host/frame_tree_node.h"
36 #include "content/browser/frame_host/render_frame_host_impl.h" 35 #include "content/browser/frame_host/render_frame_host_impl.h"
37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 36 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
38 #include "content/browser/renderer_host/render_widget_host_impl.h" 37 #include "content/browser/renderer_host/render_widget_host_impl.h"
39 #include "content/browser/web_contents/web_contents_impl.h" 38 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 " checkState();" 1013 " checkState();"
1015 " document.addEventListener('readystatechange', checkState);" 1014 " document.addEventListener('readystatechange', checkState);"
1016 "})();", 1015 "})();",
1017 &result)); 1016 &result));
1018 return result == "pageLoadComplete"; 1017 return result == "pageLoadComplete";
1019 } 1018 }
1020 1019
1021 void EnableAccessibilityForWebContents(WebContents* web_contents) { 1020 void EnableAccessibilityForWebContents(WebContents* web_contents) {
1022 WebContentsImpl* web_contents_impl = 1021 WebContentsImpl* web_contents_impl =
1023 static_cast<WebContentsImpl*>(web_contents); 1022 static_cast<WebContentsImpl*>(web_contents);
1024 web_contents_impl->SetAccessibilityMode(AccessibilityModeComplete); 1023 web_contents_impl->SetAccessibilityMode(kAccessibilityModeComplete);
1025 } 1024 }
1026 1025
1027 void WaitForAccessibilityFocusChange() { 1026 void WaitForAccessibilityFocusChange() {
1028 scoped_refptr<content::MessageLoopRunner> loop_runner( 1027 scoped_refptr<content::MessageLoopRunner> loop_runner(
1029 new content::MessageLoopRunner); 1028 new content::MessageLoopRunner);
1030 BrowserAccessibilityManager::SetFocusChangeCallbackForTesting( 1029 BrowserAccessibilityManager::SetFocusChangeCallbackForTesting(
1031 loop_runner->QuitClosure()); 1030 loop_runner->QuitClosure());
1032 loop_runner->Run(); 1031 loop_runner->Run();
1033 } 1032 }
1034 1033
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 1766
1768 std::string ascii_message = base::UTF16ToASCII(message); 1767 std::string ascii_message = base::UTF16ToASCII(message);
1769 if (base::MatchPattern(ascii_message, filter_)) { 1768 if (base::MatchPattern(ascii_message, filter_)) {
1770 message_ = ascii_message; 1769 message_ = ascii_message;
1771 message_loop_runner_->Quit(); 1770 message_loop_runner_->Quit();
1772 } 1771 }
1773 return false; 1772 return false;
1774 } 1773 }
1775 1774
1776 } // namespace content 1775 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698