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

Side by Side Diff: chrome/browser/accessibility_win_browsertest.cc

Issue 3415008: Remove use of accessible prop service from render_widget_host_view_win.cc... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/browser_accessibility_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/scoped_comptr_win.h" 8 #include "base/scoped_comptr_win.h"
9 #include "chrome/browser/automation/ui_controls.h"
9 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
10 #include "chrome/browser/browser_window.h" 11 #include "chrome/browser/browser_window.h"
11 #include "chrome/browser/renderer_host/render_view_host.h" 12 #include "chrome/browser/renderer_host/render_view_host.h"
12 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" 13 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
13 #include "chrome/browser/tab_contents/tab_contents.h" 14 #include "chrome/browser/tab_contents/tab_contents.h"
14 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/notification_type.h" 16 #include "chrome/common/notification_type.h"
16 #include "chrome/test/in_process_browser_test.h" 17 #include "chrome/test/in_process_browser_test.h"
17 #include "chrome/test/ui_test_utils.h" 18 #include "chrome/test/ui_test_utils.h"
18 #include "ia2_api_all.h" // Generated 19 #include "ia2_api_all.h" // Generated
(...skipping 24 matching lines...) Expand all
43 // This test assumes the windows system-wide SPI_SETSCREENREADER flag is 44 // This test assumes the windows system-wide SPI_SETSCREENREADER flag is
44 // cleared. 45 // cleared.
45 if (SystemParametersInfo(SPI_GETSCREENREADER, 0, &screenreader_running_, 0) && 46 if (SystemParametersInfo(SPI_GETSCREENREADER, 0, &screenreader_running_, 0) &&
46 screenreader_running_) { 47 screenreader_running_) {
47 // Clear the SPI_SETSCREENREADER flag and notify active applications about 48 // Clear the SPI_SETSCREENREADER flag and notify active applications about
48 // the setting change. 49 // the setting change.
49 ::SystemParametersInfo(SPI_SETSCREENREADER, FALSE, NULL, 0); 50 ::SystemParametersInfo(SPI_SETSCREENREADER, FALSE, NULL, 0);
50 ::SendNotifyMessage( 51 ::SendNotifyMessage(
51 HWND_BROADCAST, WM_SETTINGCHANGE, SPI_GETSCREENREADER, 0); 52 HWND_BROADCAST, WM_SETTINGCHANGE, SPI_GETSCREENREADER, 0);
52 } 53 }
54
55 // If the mouse happens to be on the document then it will have the unexpected
56 // STATE_SYSTEM_HOTTRACKED state. Move it to a non-document location.
57 ui_controls::SendMouseMove(0, 0);
53 } 58 }
54 59
55 void AccessibilityWinBrowserTest::TearDownInProcessBrowserTestFixture() { 60 void AccessibilityWinBrowserTest::TearDownInProcessBrowserTestFixture() {
56 if (screenreader_running_) { 61 if (screenreader_running_) {
57 // Restore the SPI_SETSCREENREADER flag and notify active applications about 62 // Restore the SPI_SETSCREENREADER flag and notify active applications about
58 // the setting change. 63 // the setting change.
59 ::SystemParametersInfo(SPI_SETSCREENREADER, TRUE, NULL, 0); 64 ::SystemParametersInfo(SPI_SETSCREENREADER, TRUE, NULL, 0);
60 ::SendNotifyMessage( 65 ::SendNotifyMessage(
61 HWND_BROADCAST, WM_SETTINGCHANGE, SPI_GETSCREENREADER, 0); 66 HWND_BROADCAST, WM_SETTINGCHANGE, SPI_GETSCREENREADER, 0);
62 } 67 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 ASSERT_TRUE(child_accessible.get()); 342 ASSERT_TRUE(child_accessible.get());
338 (*child_checker)->CheckAccessible(child_accessible); 343 (*child_checker)->CheckAccessible(child_accessible);
339 } 344 }
340 } 345 }
341 346
342 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, 347 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
343 TestRendererAccessibilityTree) { 348 TestRendererAccessibilityTree) {
344 // The initial accessible returned should have state STATE_SYSTEM_BUSY while 349 // The initial accessible returned should have state STATE_SYSTEM_BUSY while
345 // the accessibility tree is being requested from the renderer. 350 // the accessibility tree is being requested from the renderer.
346 AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); 351 AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L"");
347 document_checker.SetExpectedState(STATE_SYSTEM_BUSY); 352 document_checker.SetExpectedState(
353 STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED |
354 STATE_SYSTEM_BUSY);
348 document_checker.CheckAccessible(GetRendererAccessible()); 355 document_checker.CheckAccessible(GetRendererAccessible());
349 356
350 // Wait for the initial accessibility tree to load. 357 // Wait for the initial accessibility tree to load. Busy state should clear.
351 ui_test_utils::WaitForNotification( 358 ui_test_utils::WaitForNotification(
352 NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); 359 NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED);
353 360 document_checker.SetExpectedState(
354 // TODO(ctguil): Fix: We should not be expecting busy state here. 361 STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED);
355 if (0) { 362 document_checker.CheckAccessible(GetRendererAccessible());
356 // Run when above todo is fixed.
357 document_checker.SetExpectedState(0L);
358 document_checker.CheckAccessible(GetRendererAccessible());
359 }
360 363
361 GURL tree_url( 364 GURL tree_url(
362 "data:text/html,<html><head><title>Accessibility Win Test</title></head>" 365 "data:text/html,<html><head><title>Accessibility Win Test</title></head>"
363 "<body><input type='button' value='push' /><input type='checkbox' />" 366 "<body><input type='button' value='push' /><input type='checkbox' />"
364 "</body></html>"); 367 "</body></html>");
365 browser()->OpenURL(tree_url, GURL(), CURRENT_TAB, PageTransition::TYPED); 368 browser()->OpenURL(tree_url, GURL(), CURRENT_TAB, PageTransition::TYPED);
366 ui_test_utils::WaitForNotification( 369 ui_test_utils::WaitForNotification(
367 NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); 370 NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED);
368 371
369 // Check the browser's copy of the renderer accessibility tree. 372 // Check the browser's copy of the renderer accessibility tree.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 // If pointer comparison fails resort to the exhuasive search that can use 553 // If pointer comparison fails resort to the exhuasive search that can use
551 // IAccessible2::get_uniqueID for equality comparison. 554 // IAccessible2::get_uniqueID for equality comparison.
552 if (!found) { 555 if (!found) {
553 AccessibleContainsAccessible( 556 AccessibleContainsAccessible(
554 browser_accessible, document_accessible2, &found); 557 browser_accessible, document_accessible2, &found);
555 } 558 }
556 559
557 ASSERT_EQ(found, true); 560 ASSERT_EQ(found, true);
558 } 561 }
559 } // namespace. 562 } // namespace.
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_accessibility_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698