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/win/atl_module.h" |
6 #include "base/win/scoped_comptr.h" | 7 #include "base/win/scoped_comptr.h" |
7 #include "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
8 #include "content/browser/accessibility/browser_accessibility_win.h" | 9 #include "content/browser/accessibility/browser_accessibility_win.h" |
9 #include "content/common/accessibility_messages.h" | 10 #include "content/common/accessibility_messages.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "ui/base/win/atl_module.h" | |
12 | 12 |
13 using webkit_glue::WebAccessibility; | 13 using webkit_glue::WebAccessibility; |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Subclass of BrowserAccessibilityWin that counts the number of instances. | 17 // Subclass of BrowserAccessibilityWin that counts the number of instances. |
18 class CountedBrowserAccessibility : public BrowserAccessibilityWin { | 18 class CountedBrowserAccessibility : public BrowserAccessibilityWin { |
19 public: | 19 public: |
20 CountedBrowserAccessibility() { global_obj_count_++; } | 20 CountedBrowserAccessibility() { global_obj_count_++; } |
21 virtual ~CountedBrowserAccessibility() { global_obj_count_--; } | 21 virtual ~CountedBrowserAccessibility() { global_obj_count_--; } |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 EXPECT_EQ(S_OK, root_obj->get_hyperlinkIndex(14, &hyperlink_index)); | 525 EXPECT_EQ(S_OK, root_obj->get_hyperlinkIndex(14, &hyperlink_index)); |
526 EXPECT_EQ(0, hyperlink_index); | 526 EXPECT_EQ(0, hyperlink_index); |
527 EXPECT_EQ(S_OK, root_obj->get_hyperlinkIndex(30, &hyperlink_index)); | 527 EXPECT_EQ(S_OK, root_obj->get_hyperlinkIndex(30, &hyperlink_index)); |
528 EXPECT_EQ(1, hyperlink_index); | 528 EXPECT_EQ(1, hyperlink_index); |
529 | 529 |
530 // Delete the manager and test that all BrowserAccessibility instances are | 530 // Delete the manager and test that all BrowserAccessibility instances are |
531 // deleted. | 531 // deleted. |
532 delete manager; | 532 delete manager; |
533 ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_); | 533 ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_); |
534 } | 534 } |
OLD | NEW |