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

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

Issue 2867073003: Name calculation should not include nameFrom:author descendants. (Closed)
Patch Set: Rebase Created 3 years, 7 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 } 895 }
896 896
897 TEST(BrowserAccessibilityManagerTest, BoundsForRangeOnParentElement) { 897 TEST(BrowserAccessibilityManagerTest, BoundsForRangeOnParentElement) {
898 ui::AXNodeData root; 898 ui::AXNodeData root;
899 root.id = 1; 899 root.id = 1;
900 root.role = ui::AX_ROLE_ROOT_WEB_AREA; 900 root.role = ui::AX_ROLE_ROOT_WEB_AREA;
901 root.child_ids.push_back(2); 901 root.child_ids.push_back(2);
902 902
903 ui::AXNodeData div; 903 ui::AXNodeData div;
904 div.id = 2; 904 div.id = 2;
905 div.role = ui::AX_ROLE_DIV; 905 div.role = ui::AX_ROLE_GENERIC_CONTAINER;
906 div.location = gfx::RectF(100, 100, 100, 20); 906 div.location = gfx::RectF(100, 100, 100, 20);
907 div.child_ids.push_back(3); 907 div.child_ids.push_back(3);
908 div.child_ids.push_back(4); 908 div.child_ids.push_back(4);
909 div.child_ids.push_back(5); 909 div.child_ids.push_back(5);
910 910
911 ui::AXNodeData static_text1; 911 ui::AXNodeData static_text1;
912 static_text1.id = 3; 912 static_text1.id = 3;
913 static_text1.SetName("AB"); 913 static_text1.SetName("AB");
914 static_text1.role = ui::AX_ROLE_STATIC_TEXT; 914 static_text1.role = ui::AX_ROLE_STATIC_TEXT;
915 static_text1.location = gfx::RectF(100, 100, 40, 20); 915 static_text1.location = gfx::RectF(100, 100, 40, 20);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 EXPECT_EQ(nullptr, manager->PreviousTextOnlyObject(root_accessible)); 1170 EXPECT_EQ(nullptr, manager->PreviousTextOnlyObject(root_accessible));
1171 } 1171 }
1172 1172
1173 TEST(BrowserAccessibilityManagerTest, TestFindIndicesInCommonParent) { 1173 TEST(BrowserAccessibilityManagerTest, TestFindIndicesInCommonParent) {
1174 ui::AXNodeData root; 1174 ui::AXNodeData root;
1175 root.id = 1; 1175 root.id = 1;
1176 root.role = ui::AX_ROLE_ROOT_WEB_AREA; 1176 root.role = ui::AX_ROLE_ROOT_WEB_AREA;
1177 1177
1178 ui::AXNodeData div; 1178 ui::AXNodeData div;
1179 div.id = 2; 1179 div.id = 2;
1180 div.role = ui::AX_ROLE_DIV; 1180 div.role = ui::AX_ROLE_GENERIC_CONTAINER;
1181 root.child_ids.push_back(div.id); 1181 root.child_ids.push_back(div.id);
1182 1182
1183 ui::AXNodeData button; 1183 ui::AXNodeData button;
1184 button.id = 3; 1184 button.id = 3;
1185 button.role = ui::AX_ROLE_BUTTON; 1185 button.role = ui::AX_ROLE_BUTTON;
1186 div.child_ids.push_back(button.id); 1186 div.child_ids.push_back(button.id);
1187 1187
1188 ui::AXNodeData button_text; 1188 ui::AXNodeData button_text;
1189 button_text.id = 4; 1189 button_text.id = 4;
1190 button_text.role = ui::AX_ROLE_STATIC_TEXT; 1190 button_text.role = ui::AX_ROLE_STATIC_TEXT;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 EXPECT_EQ(1, child_index2); 1313 EXPECT_EQ(1, child_index2);
1314 } 1314 }
1315 1315
1316 TEST(BrowserAccessibilityManagerTest, TestGetTextForRange) { 1316 TEST(BrowserAccessibilityManagerTest, TestGetTextForRange) {
1317 ui::AXNodeData root; 1317 ui::AXNodeData root;
1318 root.id = 1; 1318 root.id = 1;
1319 root.role = ui::AX_ROLE_ROOT_WEB_AREA; 1319 root.role = ui::AX_ROLE_ROOT_WEB_AREA;
1320 1320
1321 ui::AXNodeData div; 1321 ui::AXNodeData div;
1322 div.id = 2; 1322 div.id = 2;
1323 div.role = ui::AX_ROLE_DIV; 1323 div.role = ui::AX_ROLE_GENERIC_CONTAINER;
1324 root.child_ids.push_back(div.id); 1324 root.child_ids.push_back(div.id);
1325 1325
1326 ui::AXNodeData button; 1326 ui::AXNodeData button;
1327 button.id = 3; 1327 button.id = 3;
1328 button.role = ui::AX_ROLE_BUTTON; 1328 button.role = ui::AX_ROLE_BUTTON;
1329 div.child_ids.push_back(button.id); 1329 div.child_ids.push_back(button.id);
1330 1330
1331 ui::AXNodeData button_text; 1331 ui::AXNodeData button_text;
1332 button_text.id = 4; 1332 button_text.id = 4;
1333 button_text.role = ui::AX_ROLE_STATIC_TEXT; 1333 button_text.role = ui::AX_ROLE_STATIC_TEXT;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 events2[0].event_type = ui::AX_EVENT_NONE; 1559 events2[0].event_type = ui::AX_EVENT_NONE;
1560 manager->OnAccessibilityEvents(events2); 1560 manager->OnAccessibilityEvents(events2);
1561 1561
1562 // Make sure that the focused node was updated to the new root and 1562 // Make sure that the focused node was updated to the new root and
1563 // that this doesn't crash. 1563 // that this doesn't crash.
1564 ASSERT_EQ(3, manager->GetRoot()->GetId()); 1564 ASSERT_EQ(3, manager->GetRoot()->GetId());
1565 ASSERT_EQ(3, manager->GetFocus()->GetId()); 1565 ASSERT_EQ(3, manager->GetFocus()->GetId());
1566 } 1566 }
1567 1567
1568 } // namespace content 1568 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698