| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/win/scoped_comptr.h" | 10 #include "base/win/scoped_comptr.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIVersionURL)); | 382 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIVersionURL)); |
| 383 | 383 |
| 384 // Verify that the IAccessible reference still points to a valid object and | 384 // Verify that the IAccessible reference still points to a valid object and |
| 385 // that calls to its methods fail since the tree is no longer valid after | 385 // that calls to its methods fail since the tree is no longer valid after |
| 386 // the page navagation. | 386 // the page navagation. |
| 387 CComBSTR name; | 387 CComBSTR name; |
| 388 hr = document_accessible->get_accName(CreateI4Variant(CHILDID_SELF), &name); | 388 hr = document_accessible->get_accName(CreateI4Variant(CHILDID_SELF), &name); |
| 389 ASSERT_EQ(E_FAIL, hr); | 389 ASSERT_EQ(E_FAIL, hr); |
| 390 } | 390 } |
| 391 | 391 |
| 392 // Disabled, see http://crbug.com/106957 . |
| 392 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 393 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 393 TestNotificationActiveDescendantChanged) { | 394 DISABLED_TestNotificationActiveDescendantChanged) { |
| 394 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( | 395 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( |
| 395 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, | 396 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
| 396 content::NotificationService::AllSources()); | 397 content::NotificationService::AllSources()); |
| 397 GURL tree_url("data:text/html,<ul tabindex='-1' role='radiogroup'><li id='li'" | 398 GURL tree_url("data:text/html,<ul tabindex='-1' role='radiogroup'><li id='li'" |
| 398 ">li</li></ul>"); | 399 ">li</li></ul>"); |
| 399 browser()->OpenURL( | 400 browser()->OpenURL( |
| 400 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); | 401 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); |
| 401 GetRendererAccessible(); | 402 GetRendererAccessible(); |
| 402 tree_updated_observer1.Wait(); | 403 tree_updated_observer1.Wait(); |
| 403 | 404 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 L"document.body.children[0].setAttribute('aria-activedescendant', 'li')"); | 437 L"document.body.children[0].setAttribute('aria-activedescendant', 'li')"); |
| 437 tree_updated_observer3.Wait(); | 438 tree_updated_observer3.Wait(); |
| 438 | 439 |
| 439 // Check that the accessibility tree of the browser has been updated. | 440 // Check that the accessibility tree of the browser has been updated. |
| 440 list_item_checker.SetExpectedState( | 441 list_item_checker.SetExpectedState( |
| 441 STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSED); | 442 STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSED); |
| 442 radio_group_checker.SetExpectedState(STATE_SYSTEM_FOCUSABLE); | 443 radio_group_checker.SetExpectedState(STATE_SYSTEM_FOCUSABLE); |
| 443 document_checker.CheckAccessible(GetRendererAccessible()); | 444 document_checker.CheckAccessible(GetRendererAccessible()); |
| 444 } | 445 } |
| 445 | 446 |
| 447 // Disabled, see http://crbug.com/106957 . |
| 446 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 448 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 447 TestNotificationCheckedStateChanged) { | 449 DISABLED_TestNotificationCheckedStateChanged) { |
| 448 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( | 450 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( |
| 449 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, | 451 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
| 450 content::NotificationService::AllSources()); | 452 content::NotificationService::AllSources()); |
| 451 GURL tree_url("data:text/html,<body><input type='checkbox' /></body>"); | 453 GURL tree_url("data:text/html,<body><input type='checkbox' /></body>"); |
| 452 browser()->OpenURL( | 454 browser()->OpenURL( |
| 453 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); | 455 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); |
| 454 GetRendererAccessible(); | 456 GetRendererAccessible(); |
| 455 tree_updated_observer1.Wait(); | 457 tree_updated_observer1.Wait(); |
| 456 | 458 |
| 457 // Check the browser's copy of the renderer accessibility tree. | 459 // Check the browser's copy of the renderer accessibility tree. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 469 content::NotificationService::AllSources()); | 471 content::NotificationService::AllSources()); |
| 470 ExecuteScript(L"document.body.children[0].checked=true"); | 472 ExecuteScript(L"document.body.children[0].checked=true"); |
| 471 tree_updated_observer2.Wait(); | 473 tree_updated_observer2.Wait(); |
| 472 | 474 |
| 473 // Check that the accessibility tree of the browser has been updated. | 475 // Check that the accessibility tree of the browser has been updated. |
| 474 checkbox_checker.SetExpectedState( | 476 checkbox_checker.SetExpectedState( |
| 475 STATE_SYSTEM_CHECKED | STATE_SYSTEM_FOCUSABLE); | 477 STATE_SYSTEM_CHECKED | STATE_SYSTEM_FOCUSABLE); |
| 476 document_checker.CheckAccessible(GetRendererAccessible()); | 478 document_checker.CheckAccessible(GetRendererAccessible()); |
| 477 } | 479 } |
| 478 | 480 |
| 481 // Disabled, see http://crbug.com/106957 . |
| 479 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 482 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 480 TestNotificationChildrenChanged) { | 483 DISABLED_TestNotificationChildrenChanged) { |
| 481 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( | 484 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( |
| 482 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, | 485 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
| 483 content::NotificationService::AllSources()); | 486 content::NotificationService::AllSources()); |
| 484 // The role attribute causes the node to be in the accessibility tree. | 487 // The role attribute causes the node to be in the accessibility tree. |
| 485 GURL tree_url( | 488 GURL tree_url( |
| 486 "data:text/html,<body role=group></body>"); | 489 "data:text/html,<body role=group></body>"); |
| 487 browser()->OpenURL( | 490 browser()->OpenURL( |
| 488 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); | 491 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); |
| 489 GetRendererAccessible(); | 492 GetRendererAccessible(); |
| 490 tree_updated_observer1.Wait(); | 493 tree_updated_observer1.Wait(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 501 content::NotificationService::AllSources()); | 504 content::NotificationService::AllSources()); |
| 502 ExecuteScript(L"document.body.innerHTML='<b>new text</b>'"); | 505 ExecuteScript(L"document.body.innerHTML='<b>new text</b>'"); |
| 503 tree_updated_observer2.Wait(); | 506 tree_updated_observer2.Wait(); |
| 504 | 507 |
| 505 // Check that the accessibility tree of the browser has been updated. | 508 // Check that the accessibility tree of the browser has been updated. |
| 506 AccessibleChecker text_checker(L"new text", ROLE_SYSTEM_TEXT, L""); | 509 AccessibleChecker text_checker(L"new text", ROLE_SYSTEM_TEXT, L""); |
| 507 body_checker.AppendExpectedChild(&text_checker); | 510 body_checker.AppendExpectedChild(&text_checker); |
| 508 document_checker.CheckAccessible(GetRendererAccessible()); | 511 document_checker.CheckAccessible(GetRendererAccessible()); |
| 509 } | 512 } |
| 510 | 513 |
| 514 // Disabled, see http://crbug.com/106957 . |
| 511 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 515 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 512 TestNotificationChildrenChanged2) { | 516 DISABLED_TestNotificationChildrenChanged2) { |
| 513 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( | 517 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( |
| 514 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, | 518 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
| 515 content::NotificationService::AllSources()); | 519 content::NotificationService::AllSources()); |
| 516 // The role attribute causes the node to be in the accessibility tree. | 520 // The role attribute causes the node to be in the accessibility tree. |
| 517 GURL tree_url( | 521 GURL tree_url( |
| 518 "data:text/html,<div role=group style='visibility: hidden'>text" | 522 "data:text/html,<div role=group style='visibility: hidden'>text" |
| 519 "</div>"); | 523 "</div>"); |
| 520 browser()->OpenURL( | 524 browser()->OpenURL( |
| 521 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); | 525 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); |
| 522 GetRendererAccessible(); | 526 GetRendererAccessible(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 534 tree_updated_observer2.Wait(); | 538 tree_updated_observer2.Wait(); |
| 535 | 539 |
| 536 // Check that the accessibility tree of the browser has been updated. | 540 // Check that the accessibility tree of the browser has been updated. |
| 537 AccessibleChecker static_text_checker(L"text", ROLE_SYSTEM_TEXT, L""); | 541 AccessibleChecker static_text_checker(L"text", ROLE_SYSTEM_TEXT, L""); |
| 538 AccessibleChecker div_checker(L"", L"div", L""); | 542 AccessibleChecker div_checker(L"", L"div", L""); |
| 539 document_checker.AppendExpectedChild(&div_checker); | 543 document_checker.AppendExpectedChild(&div_checker); |
| 540 div_checker.AppendExpectedChild(&static_text_checker); | 544 div_checker.AppendExpectedChild(&static_text_checker); |
| 541 document_checker.CheckAccessible(GetRendererAccessible()); | 545 document_checker.CheckAccessible(GetRendererAccessible()); |
| 542 } | 546 } |
| 543 | 547 |
| 548 // Disabled, see http://crbug.com/106957 . |
| 544 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, | 549 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, |
| 545 TestNotificationFocusChanged) { | 550 DISABLED_TestNotificationFocusChanged) { |
| 546 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( | 551 ui_test_utils::WindowedNotificationObserver tree_updated_observer1( |
| 547 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, | 552 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
| 548 content::NotificationService::AllSources()); | 553 content::NotificationService::AllSources()); |
| 549 // The role attribute causes the node to be in the accessibility tree. | 554 // The role attribute causes the node to be in the accessibility tree. |
| 550 GURL tree_url( | 555 GURL tree_url( |
| 551 "data:text/html,<div role=group tabindex='-1'></div>"); | 556 "data:text/html,<div role=group tabindex='-1'></div>"); |
| 552 browser()->OpenURL( | 557 browser()->OpenURL( |
| 553 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); | 558 tree_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED); |
| 554 GetRendererAccessible(); | 559 GetRendererAccessible(); |
| 555 tree_updated_observer1.Wait(); | 560 tree_updated_observer1.Wait(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 ASSERT_EQ(S_OK, hr); | 727 ASSERT_EQ(S_OK, hr); |
| 723 hr = checkbox_isimpledomnode->get_nodeInfo( | 728 hr = checkbox_isimpledomnode->get_nodeInfo( |
| 724 &node_name, &name_space_id, &node_value, &num_children, &unique_id, | 729 &node_name, &name_space_id, &node_value, &num_children, &unique_id, |
| 725 &node_type); | 730 &node_type); |
| 726 ASSERT_EQ(S_OK, hr); | 731 ASSERT_EQ(S_OK, hr); |
| 727 EXPECT_STREQ(L"input", wstring(node_name, SysStringLen(node_name)).c_str()); | 732 EXPECT_STREQ(L"input", wstring(node_name, SysStringLen(node_name)).c_str()); |
| 728 EXPECT_EQ(NODETYPE_ELEMENT, node_type); | 733 EXPECT_EQ(NODETYPE_ELEMENT, node_type); |
| 729 EXPECT_EQ(0, num_children); | 734 EXPECT_EQ(0, num_children); |
| 730 } | 735 } |
| 731 } // namespace. | 736 } // namespace. |
| OLD | NEW |