| 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 // Ensure we properly cleaned up. | 710 // Ensure we properly cleaned up. |
| 711 manager.reset(); | 711 manager.reset(); |
| 712 ASSERT_EQ(0, CountedBrowserAccessibility::num_instances()); | 712 ASSERT_EQ(0, CountedBrowserAccessibility::num_instances()); |
| 713 } | 713 } |
| 714 | 714 |
| 715 TEST(BrowserAccessibilityManagerWinTest, TestAccessibleHWND) { | 715 TEST(BrowserAccessibilityManagerWinTest, TestAccessibleHWND) { |
| 716 HWND desktop_hwnd = GetDesktopWindow(); | 716 HWND desktop_hwnd = GetDesktopWindow(); |
| 717 base::win::ScopedComPtr<IAccessible> desktop_hwnd_iaccessible; | 717 base::win::ScopedComPtr<IAccessible> desktop_hwnd_iaccessible; |
| 718 ASSERT_EQ(S_OK, AccessibleObjectFromWindow( | 718 ASSERT_EQ(S_OK, AccessibleObjectFromWindow( |
| 719 desktop_hwnd, OBJID_CLIENT, | 719 desktop_hwnd, static_cast<DWORD>(OBJID_CLIENT), |
| 720 IID_IAccessible, | 720 IID_IAccessible, |
| 721 reinterpret_cast<void**>(desktop_hwnd_iaccessible.Receive()))); | 721 reinterpret_cast<void**>(desktop_hwnd_iaccessible.Receive()))); |
| 722 | 722 |
| 723 scoped_ptr<TestLegacyRenderWidgetHostHWND> accessibility_test | 723 scoped_ptr<TestLegacyRenderWidgetHostHWND> accessibility_test |
| 724 (new TestLegacyRenderWidgetHostHWND); | 724 (new TestLegacyRenderWidgetHostHWND); |
| 725 EXPECT_EQ(accessibility_test->Initialize(GetDesktopWindow()), true); | 725 EXPECT_EQ(accessibility_test->Initialize(GetDesktopWindow()), true); |
| 726 | 726 |
| 727 scoped_ptr<BrowserAccessibilityManagerWin> manager( | 727 scoped_ptr<BrowserAccessibilityManagerWin> manager( |
| 728 new BrowserAccessibilityManagerWin( | 728 new BrowserAccessibilityManagerWin( |
| 729 accessibility_test->accessible_hwnd(), | 729 accessibility_test->accessible_hwnd(), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 760 manager->MaybeCallNotifyWinEvent(0, 0); | 760 manager->MaybeCallNotifyWinEvent(0, 0); |
| 761 new_parent_hwnd = manager->parent_hwnd(); | 761 new_parent_hwnd = manager->parent_hwnd(); |
| 762 ASSERT_FALSE(NULL == new_parent_hwnd); | 762 ASSERT_FALSE(NULL == new_parent_hwnd); |
| 763 | 763 |
| 764 // This time, destroy the manager first, make sure the AccessibleHWND doesn't | 764 // This time, destroy the manager first, make sure the AccessibleHWND doesn't |
| 765 // crash on destruction (to be caught by SyzyASAN or other tools). | 765 // crash on destruction (to be caught by SyzyASAN or other tools). |
| 766 manager.reset(NULL); | 766 manager.reset(NULL); |
| 767 } | 767 } |
| 768 | 768 |
| 769 } // namespace content | 769 } // namespace content |
| OLD | NEW |