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

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

Issue 121033002: Update uses of UTF conversions in content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698