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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/public/browser/notification_service.h" 10 #include "content/public/browser/notification_service.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Convenience method to get the value of a particular AccessibilityNodeData 100 // Convenience method to get the value of a particular AccessibilityNodeData
101 // node attribute as a UTF-8 const char*. 101 // node attribute as a UTF-8 const char*.
102 std::string CrossPlatformAccessibilityBrowserTest::GetAttr( 102 std::string CrossPlatformAccessibilityBrowserTest::GetAttr(
103 const AccessibilityNodeData& node, 103 const AccessibilityNodeData& node,
104 const AccessibilityNodeData::StringAttribute attr) { 104 const AccessibilityNodeData::StringAttribute attr) {
105 std::map<AccessibilityNodeData::StringAttribute, string16>::const_iterator 105 std::map<AccessibilityNodeData::StringAttribute, string16>::const_iterator
106 iter = node.string_attributes.find(attr); 106 iter = node.string_attributes.find(attr);
107 if (iter != node.string_attributes.end()) 107 if (iter != node.string_attributes.end())
108 return UTF16ToUTF8(iter->second); 108 return UTF16ToUTF8(iter->second);
109 else 109 else
110 return ""; 110 return std::string();
111 } 111 }
112 112
113 // Convenience method to get the value of a particular AccessibilityNodeData 113 // Convenience method to get the value of a particular AccessibilityNodeData
114 // node integer attribute. 114 // node integer attribute.
115 int CrossPlatformAccessibilityBrowserTest::GetIntAttr( 115 int CrossPlatformAccessibilityBrowserTest::GetIntAttr(
116 const AccessibilityNodeData& node, 116 const AccessibilityNodeData& node,
117 const AccessibilityNodeData::IntAttribute attr) { 117 const AccessibilityNodeData::IntAttribute attr) {
118 std::map<AccessibilityNodeData::IntAttribute, int32>::const_iterator iter = 118 std::map<AccessibilityNodeData::IntAttribute, int32>::const_iterator iter =
119 node.int_attributes.find(attr); 119 node.int_attributes.find(attr);
120 if (iter != node.int_attributes.end()) 120 if (iter != node.int_attributes.end())
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 const AccessibilityNodeDataTreeNode& tree = GetAccessibilityNodeDataTree(); 465 const AccessibilityNodeDataTreeNode& tree = GetAccessibilityNodeDataTree();
466 466
467 ASSERT_EQ(1U, tree.children.size()); 467 ASSERT_EQ(1U, tree.children.size());
468 const AccessibilityNodeDataTreeNode& textbox = tree.children[0]; 468 const AccessibilityNodeDataTreeNode& textbox = tree.children[0];
469 469
470 EXPECT_EQ( 470 EXPECT_EQ(
471 true, GetBoolAttr(textbox, AccessibilityNodeData::ATTR_CAN_SET_VALUE)); 471 true, GetBoolAttr(textbox, AccessibilityNodeData::ATTR_CAN_SET_VALUE));
472 } 472 }
473 473
474 } // namespace content 474 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/accessibility_tree_formatter.cc ('k') | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698