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

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

Issue 1114683002: Filter out AX window events to make tests less flaky. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/browser/accessibility/accessibility_event_recorder.h" 5 #include "content/browser/accessibility/accessibility_event_recorder.h"
6 6
7 #include <oleacc.h> 7 #include <oleacc.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 base::win::ScopedVariant role; 199 base::win::ScopedVariant role;
200 iaccessible->get_accRole(childid_self, role.Receive()); 200 iaccessible->get_accRole(childid_self, role.Receive());
201 base::win::ScopedBstr name_bstr; 201 base::win::ScopedBstr name_bstr;
202 iaccessible->get_accName(childid_self, name_bstr.Receive()); 202 iaccessible->get_accName(childid_self, name_bstr.Receive());
203 base::win::ScopedBstr value_bstr; 203 base::win::ScopedBstr value_bstr;
204 iaccessible->get_accValue(childid_self, value_bstr.Receive()); 204 iaccessible->get_accValue(childid_self, value_bstr.Receive());
205 base::win::ScopedVariant state; 205 base::win::ScopedVariant state;
206 iaccessible->get_accState(childid_self, state.Receive()); 206 iaccessible->get_accState(childid_self, state.Receive());
207 int ia_state = V_I4(state.ptr()); 207 int ia_state = V_I4(state.ptr());
208 208
209 // Avoid flakiness. Events fired on a WINDOW are out of the control
210 // of a test.
211 if (role.type() == VT_I4 && ROLE_SYSTEM_WINDOW == V_I4(role.ptr())) {
212 VLOG(1) << "Ignoring event " << event << " on ROLE_SYSTEM_WINDOW";
213 return;
214 }
215
209 // Avoid flakiness. The "offscreen" state depends on whether the browser 216 // Avoid flakiness. The "offscreen" state depends on whether the browser
210 // window is frontmost or not, and "hottracked" depends on whether the 217 // window is frontmost or not, and "hottracked" depends on whether the
211 // mouse cursor happens to be over the element. 218 // mouse cursor happens to be over the element.
212 ia_state &= (~STATE_SYSTEM_OFFSCREEN & ~STATE_SYSTEM_HOTTRACKED); 219 ia_state &= (~STATE_SYSTEM_OFFSCREEN & ~STATE_SYSTEM_HOTTRACKED);
213 220
214 // The "readonly" state is set on almost every node and doesn't typically 221 // The "readonly" state is set on almost every node and doesn't typically
215 // change, so filter it out to keep the output less verbose. 222 // change, so filter it out to keep the output less verbose.
216 ia_state &= ~STATE_SYSTEM_READONLY; 223 ia_state &= ~STATE_SYSTEM_READONLY;
217 224
218 AccessibleStates ia2_state = 0; 225 AccessibleStates ia2_state = 0;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 if (accessibility_hwnd != hwnd) 283 if (accessibility_hwnd != hwnd)
277 return E_FAIL; 284 return E_FAIL;
278 285
279 IAccessible* obj = manager_->GetRoot()->ToBrowserAccessibilityWin(); 286 IAccessible* obj = manager_->GetRoot()->ToBrowserAccessibilityWin();
280 obj->AddRef(); 287 obj->AddRef();
281 *ppv_object = obj; 288 *ppv_object = obj;
282 return S_OK; 289 return S_OK;
283 } 290 }
284 291
285 } // namespace content 292 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698