| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 manager->GetRoot()->ToBrowserAccessibilityWin(); | 542 manager->GetRoot()->ToBrowserAccessibilityWin(); |
| 543 | 543 |
| 544 long text_len; | 544 long text_len; |
| 545 ASSERT_EQ(S_OK, root_obj->get_nCharacters(&text_len)); | 545 ASSERT_EQ(S_OK, root_obj->get_nCharacters(&text_len)); |
| 546 | 546 |
| 547 base::win::ScopedBstr text; | 547 base::win::ScopedBstr text; |
| 548 ASSERT_EQ(S_OK, root_obj->get_text(0, text_len, text.Receive())); | 548 ASSERT_EQ(S_OK, root_obj->get_text(0, text_len, text.Receive())); |
| 549 const std::string embed = base::UTF16ToUTF8( | 549 const std::string embed = base::UTF16ToUTF8( |
| 550 BrowserAccessibilityWin::kEmbeddedCharacter); | 550 BrowserAccessibilityWin::kEmbeddedCharacter); |
| 551 EXPECT_EQ(text1_name + embed + text2_name + embed, | 551 EXPECT_EQ(text1_name + embed + text2_name + embed, |
| 552 UTF16ToUTF8(base::string16(text))); | 552 base::UTF16ToUTF8(base::string16(text))); |
| 553 text.Reset(); | 553 text.Reset(); |
| 554 | 554 |
| 555 long hyperlink_count; | 555 long hyperlink_count; |
| 556 ASSERT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count)); | 556 ASSERT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count)); |
| 557 EXPECT_EQ(2, hyperlink_count); | 557 EXPECT_EQ(2, hyperlink_count); |
| 558 | 558 |
| 559 base::win::ScopedComPtr<IAccessibleHyperlink> hyperlink; | 559 base::win::ScopedComPtr<IAccessibleHyperlink> hyperlink; |
| 560 base::win::ScopedComPtr<IAccessibleText> hypertext; | 560 base::win::ScopedComPtr<IAccessibleText> hypertext; |
| 561 EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(-1, hyperlink.Receive())); | 561 EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(-1, hyperlink.Receive())); |
| 562 EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(2, hyperlink.Receive())); | 562 EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(2, hyperlink.Receive())); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 new_parent_hwnd = manager->parent_hwnd(); | 725 new_parent_hwnd = manager->parent_hwnd(); |
| 726 ASSERT_FALSE(NULL == new_parent_hwnd); | 726 ASSERT_FALSE(NULL == new_parent_hwnd); |
| 727 | 727 |
| 728 // This time, destroy the manager first, make sure the AccessibleHWND doesn't | 728 // This time, destroy the manager first, make sure the AccessibleHWND doesn't |
| 729 // crash on destruction (to be caught by SyzyASAN or other tools). | 729 // crash on destruction (to be caught by SyzyASAN or other tools). |
| 730 manager.reset(NULL); | 730 manager.reset(NULL); |
| 731 } | 731 } |
| 732 #endif | 732 #endif |
| 733 | 733 |
| 734 } // namespace content | 734 } // namespace content |
| OLD | NEW |