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

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

Issue 642313003: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Including id in the AUTHORS file. Created 6 years, 2 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/scoped_bstr.h" 9 #include "base/win/scoped_bstr.h"
10 #include "base/win/scoped_comptr.h" 10 #include "base/win/scoped_comptr.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED); 587 STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED);
588 document_checker.CheckAccessible(GetRendererAccessible()); 588 document_checker.CheckAccessible(GetRendererAccessible());
589 589
590 // Focus the document accessible. This will un-focus the current node. 590 // Focus the document accessible. This will un-focus the current node.
591 waiter.reset( 591 waiter.reset(
592 new AccessibilityNotificationWaiter( 592 new AccessibilityNotificationWaiter(
593 shell(), AccessibilityModeComplete, 593 shell(), AccessibilityModeComplete,
594 ui::AX_EVENT_BLUR)); 594 ui::AX_EVENT_BLUR));
595 base::win::ScopedComPtr<IAccessible> document_accessible( 595 base::win::ScopedComPtr<IAccessible> document_accessible(
596 GetRendererAccessible()); 596 GetRendererAccessible());
597 ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL)); 597 ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(nullptr));
dmazzoni 2014/10/10 16:49:49 same here, shouldn't be necessary to cast - let's
598 base::win::ScopedVariant childid_self(CHILDID_SELF); 598 base::win::ScopedVariant childid_self(CHILDID_SELF);
599 HRESULT hr = document_accessible->accSelect(SELFLAG_TAKEFOCUS, childid_self); 599 HRESULT hr = document_accessible->accSelect(SELFLAG_TAKEFOCUS, childid_self);
600 ASSERT_EQ(S_OK, hr); 600 ASSERT_EQ(S_OK, hr);
601 waiter->WaitForNotification(); 601 waiter->WaitForNotification();
602 602
603 // Check that the accessibility tree of the browser has been updated. 603 // Check that the accessibility tree of the browser has been updated.
604 SCOPED_TRACE("Check updated tree after focusing document again"); 604 SCOPED_TRACE("Check updated tree after focusing document again");
605 group_checker.SetExpectedState(STATE_SYSTEM_FOCUSABLE); 605 group_checker.SetExpectedState(STATE_SYSTEM_FOCUSABLE);
606 document_checker.CheckAccessible(GetRendererAccessible()); 606 document_checker.CheckAccessible(GetRendererAccessible());
607 } 607 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 673 }
674 674
675 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, 675 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
676 SupportsISimpleDOM) { 676 SupportsISimpleDOM) {
677 LoadInitialAccessibilityTreeFromHtml( 677 LoadInitialAccessibilityTreeFromHtml(
678 "<body><input type='checkbox' /></body>"); 678 "<body><input type='checkbox' /></body>");
679 679
680 // Get the IAccessible object for the document. 680 // Get the IAccessible object for the document.
681 base::win::ScopedComPtr<IAccessible> document_accessible( 681 base::win::ScopedComPtr<IAccessible> document_accessible(
682 GetRendererAccessible()); 682 GetRendererAccessible());
683 ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL)); 683 ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(nullptr));
684 684
685 // Get the ISimpleDOM object for the document. 685 // Get the ISimpleDOM object for the document.
686 base::win::ScopedComPtr<IServiceProvider> service_provider; 686 base::win::ScopedComPtr<IServiceProvider> service_provider;
687 HRESULT hr = static_cast<IAccessible*>(document_accessible)->QueryInterface( 687 HRESULT hr = static_cast<IAccessible*>(document_accessible)->QueryInterface(
688 service_provider.Receive()); 688 service_provider.Receive());
689 ASSERT_EQ(S_OK, hr); 689 ASSERT_EQ(S_OK, hr);
690 const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, 690 const GUID refguid = {0x0c539790, 0x12e4, 0x11cf,
691 0xb6, 0x61, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8}; 691 0xb6, 0x61, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8};
692 base::win::ScopedComPtr<ISimpleDOMNode> document_isimpledomnode; 692 base::win::ScopedComPtr<ISimpleDOMNode> document_isimpledomnode;
693 hr = static_cast<IServiceProvider *>(service_provider)->QueryService( 693 hr = static_cast<IServiceProvider *>(service_provider)->QueryService(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING, 747 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING,
748 std::wstring()); 748 std::wstring());
749 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT, 749 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT,
750 std::wstring()); 750 std::wstring());
751 document_checker.AppendExpectedChild(&grouping1_checker); 751 document_checker.AppendExpectedChild(&grouping1_checker);
752 document_checker.AppendExpectedChild(&grouping2_checker); 752 document_checker.AppendExpectedChild(&grouping2_checker);
753 document_checker.CheckAccessible(GetRendererAccessible()); 753 document_checker.CheckAccessible(GetRendererAccessible());
754 } 754 }
755 755
756 } // namespace content 756 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698