| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |