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

Side by Side Diff: content/browser/accessibility/dump_accessibility_events_browsertest.cc

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 months 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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 // Create a waiter that waits for any one accessibility event. 83 // Create a waiter that waits for any one accessibility event.
84 // This will ensure that after calling the go() function, we 84 // This will ensure that after calling the go() function, we
85 // block until we've received an accessibility event generated as 85 // block until we've received an accessibility event generated as
86 // a result of this function. 86 // a result of this function.
87 scoped_ptr<AccessibilityNotificationWaiter> waiter; 87 scoped_ptr<AccessibilityNotificationWaiter> waiter;
88 waiter.reset(new AccessibilityNotificationWaiter( 88 waiter.reset(new AccessibilityNotificationWaiter(
89 shell(), AccessibilityModeComplete, ui::AX_EVENT_NONE)); 89 shell(), AccessibilityModeComplete, ui::AX_EVENT_NONE));
90 90
91 91
92 web_contents->GetMainFrame()->ExecuteJavaScript( 92 web_contents->GetMainFrame()->ExecuteJavaScriptForTests(
93 base::ASCIIToUTF16("go()")); 93 base::ASCIIToUTF16("go()"));
94 94
95 // Wait for at least one accessibility event generated in response to 95 // Wait for at least one accessibility event generated in response to
96 // that function. 96 // that function.
97 waiter->WaitForNotification(); 97 waiter->WaitForNotification();
98 98
99 // More than one accessibility event could have been generated. 99 // More than one accessibility event could have been generated.
100 // To make sure we've received all accessibility events, add a 100 // To make sure we've received all accessibility events, add a
101 // sentinel by calling AccessibilityHitTest and waiting for a HOVER 101 // sentinel by calling AccessibilityHitTest and waiting for a HOVER
102 // event in response. 102 // event in response.
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, 266 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest,
267 AccessibilityEventsTextChanged) { 267 AccessibilityEventsTextChanged) {
268 RunEventTest(FILE_PATH_LITERAL("text-changed.html")); 268 RunEventTest(FILE_PATH_LITERAL("text-changed.html"));
269 } 269 }
270 270
271 #endif // defined(OS_WIN) 271 #endif // defined(OS_WIN)
272 272
273 } // namespace content 273 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/accessibility_win_browsertest.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698