OLD | NEW |
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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "base/win/scoped_bstr.h" | 7 #include "base/win/scoped_bstr.h" |
8 #include "base/win/scoped_comptr.h" | 8 #include "base/win/scoped_comptr.h" |
9 #include "base/win/scoped_variant.h" | 9 #include "base/win/scoped_variant.h" |
10 #include "content/browser/accessibility/browser_accessibility_manager.h" | 10 #include "content/browser/accessibility/browser_accessibility_manager.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 674 |
675 // And the new child exists. | 675 // And the new child exists. |
676 EXPECT_EQ(ui::AX_ROLE_BUTTON, acc2_2->role()); | 676 EXPECT_EQ(ui::AX_ROLE_BUTTON, acc2_2->role()); |
677 EXPECT_EQ(3, acc2_2->renderer_id()); | 677 EXPECT_EQ(3, acc2_2->renderer_id()); |
678 | 678 |
679 // Ensure we properly cleaned up. | 679 // Ensure we properly cleaned up. |
680 manager.reset(); | 680 manager.reset(); |
681 ASSERT_EQ(0, CountedBrowserAccessibility::num_instances()); | 681 ASSERT_EQ(0, CountedBrowserAccessibility::num_instances()); |
682 } | 682 } |
683 | 683 |
684 #if defined(USE_AURA) | |
685 TEST(BrowserAccessibilityManagerWinTest, TestAccessibleHWND) { | 684 TEST(BrowserAccessibilityManagerWinTest, TestAccessibleHWND) { |
686 HWND desktop_hwnd = GetDesktopWindow(); | 685 HWND desktop_hwnd = GetDesktopWindow(); |
687 base::win::ScopedComPtr<IAccessible> desktop_hwnd_iaccessible; | 686 base::win::ScopedComPtr<IAccessible> desktop_hwnd_iaccessible; |
688 ASSERT_EQ(S_OK, AccessibleObjectFromWindow( | 687 ASSERT_EQ(S_OK, AccessibleObjectFromWindow( |
689 desktop_hwnd, OBJID_CLIENT, | 688 desktop_hwnd, OBJID_CLIENT, |
690 IID_IAccessible, | 689 IID_IAccessible, |
691 reinterpret_cast<void**>(desktop_hwnd_iaccessible.Receive()))); | 690 reinterpret_cast<void**>(desktop_hwnd_iaccessible.Receive()))); |
692 | 691 |
693 scoped_ptr<BrowserAccessibilityManagerWin> manager( | 692 scoped_ptr<BrowserAccessibilityManagerWin> manager( |
694 new BrowserAccessibilityManagerWin( | 693 new BrowserAccessibilityManagerWin( |
(...skipping 27 matching lines...) Expand all Loading... |
722 BrowserAccessibilityManagerWin::GetEmptyDocument(), | 721 BrowserAccessibilityManagerWin::GetEmptyDocument(), |
723 NULL)); | 722 NULL)); |
724 manager->MaybeCallNotifyWinEvent(0, 0); | 723 manager->MaybeCallNotifyWinEvent(0, 0); |
725 new_parent_hwnd = manager->parent_hwnd(); | 724 new_parent_hwnd = manager->parent_hwnd(); |
726 ASSERT_FALSE(NULL == new_parent_hwnd); | 725 ASSERT_FALSE(NULL == new_parent_hwnd); |
727 | 726 |
728 // This time, destroy the manager first, make sure the AccessibleHWND doesn't | 727 // This time, destroy the manager first, make sure the AccessibleHWND doesn't |
729 // crash on destruction (to be caught by SyzyASAN or other tools). | 728 // crash on destruction (to be caught by SyzyASAN or other tools). |
730 manager.reset(NULL); | 729 manager.reset(NULL); |
731 } | 730 } |
732 #endif | |
733 | 731 |
734 } // namespace content | 732 } // namespace content |
OLD | NEW |