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

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

Issue 373873002: Fixes for re-enabling more MSVC level 4 warnings: content/browser/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/appcache/appcache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/appcache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698