| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bri
dge.h" | 5 #include "chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bri
dge.h" |
| 6 | 6 |
| 7 #include <unordered_map> | 7 #include <unordered_map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 helper_bridge->OnTaskCreated(1, "com.android.vending", "launch", ""); | 137 helper_bridge->OnTaskCreated(1, "com.android.vending", "launch", ""); |
| 138 ASSERT_EQ(0U, package_to_tree.size()); | 138 ASSERT_EQ(0U, package_to_tree.size()); |
| 139 ASSERT_EQ(1U, package_to_ids.size()); | 139 ASSERT_EQ(1U, package_to_ids.size()); |
| 140 auto it1 = package_to_ids.find("com.android.vending"); | 140 auto it1 = package_to_ids.find("com.android.vending"); |
| 141 ASSERT_NE(package_to_ids.end(), it1); | 141 ASSERT_NE(package_to_ids.end(), it1); |
| 142 ASSERT_EQ(1U, it1->second.size()); | 142 ASSERT_EQ(1U, it1->second.size()); |
| 143 ASSERT_EQ(1U, it1->second.count(1)); | 143 ASSERT_EQ(1U, it1->second.count(1)); |
| 144 | 144 |
| 145 auto event = arc::mojom::AccessibilityEventData::New(); | 145 auto event = arc::mojom::AccessibilityEventData::New(); |
| 146 event->sourceId = 1; | 146 event->source_id = 1; |
| 147 event->eventType = arc::mojom::AccessibilityEventType::VIEW_FOCUSED; | 147 event->event_type = arc::mojom::AccessibilityEventType::VIEW_FOCUSED; |
| 148 event->nodeData.push_back(arc::mojom::AccessibilityNodeInfoData::New()); | 148 event->node_data.push_back(arc::mojom::AccessibilityNodeInfoData::New()); |
| 149 event->nodeData[0]->id = 1; | 149 event->node_data[0]->id = 1; |
| 150 event->nodeData[0]->stringProperties = | 150 event->node_data[0]->string_properties = |
| 151 std::unordered_map<arc::mojom::AccessibilityStringProperty, | 151 std::unordered_map<arc::mojom::AccessibilityStringProperty, |
| 152 std::string>(); | 152 std::string>(); |
| 153 event->nodeData[0]->stringProperties.value().insert( | 153 event->node_data[0]->string_properties.value().insert( |
| 154 std::make_pair(arc::mojom::AccessibilityStringProperty::PACKAGE_NAME, | 154 std::make_pair(arc::mojom::AccessibilityStringProperty::PACKAGE_NAME, |
| 155 "com.android.vending")); | 155 "com.android.vending")); |
| 156 | 156 |
| 157 // Task 1 is not current; gets rejected. | 157 // Task 1 is not current; gets rejected. |
| 158 helper_bridge->OnAccessibilityEvent(event.Clone()); | 158 helper_bridge->OnAccessibilityEvent(event.Clone()); |
| 159 ASSERT_EQ(0U, package_to_tree.size()); | 159 ASSERT_EQ(0U, package_to_tree.size()); |
| 160 | 160 |
| 161 // Task 1 is now current. | 161 // Task 1 is now current. |
| 162 helper_bridge->OnTaskSetActive(1); | 162 helper_bridge->OnTaskSetActive(1); |
| 163 helper_bridge->OnAccessibilityEvent(event.Clone()); | 163 helper_bridge->OnAccessibilityEvent(event.Clone()); |
| 164 ASSERT_EQ(1U, package_to_tree.size()); | 164 ASSERT_EQ(1U, package_to_tree.size()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace arc | 167 } // namespace arc |
| OLD | NEW |