Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: content/browser/accessibility/browser_accessibility_win_unittest.cc

Issue 10399084: Fix crash in the accessibility code in the shared build. The problem is that the ATL module pointer… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update license header in atl_module.h Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698