| 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 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 int command_id; | 519 int command_id; |
| 520 int expected_index; | 520 int expected_index; |
| 521 int expected_count; | 521 int expected_count; |
| 522 } kTestCases[] = { | 522 } kTestCases[] = { |
| 523 { SimpleMenuDelegate::IDC_MENU_ITEM_1, 0, 3 }, | 523 { SimpleMenuDelegate::IDC_MENU_ITEM_1, 0, 3 }, |
| 524 { SimpleMenuDelegate::IDC_MENU_ITEM_2, 1, 3 }, | 524 { SimpleMenuDelegate::IDC_MENU_ITEM_2, 1, 3 }, |
| 525 { SimpleMenuDelegate::IDC_MENU_INVISIBLE, 0, 3 }, | 525 { SimpleMenuDelegate::IDC_MENU_INVISIBLE, 0, 3 }, |
| 526 { SimpleMenuDelegate::IDC_MENU_ITEM_3, 2, 3 }, | 526 { SimpleMenuDelegate::IDC_MENU_ITEM_3, 2, 3 }, |
| 527 }; | 527 }; |
| 528 | 528 |
| 529 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { | 529 for (size_t i = 0; i < arraysize(kTestCases); ++i) { |
| 530 int index = 0; | 530 int index = 0; |
| 531 int count = 0; | 531 int count = 0; |
| 532 | 532 |
| 533 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( | 533 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( |
| 534 menu_container, | 534 menu_container, |
| 535 menu->GetMenuItemByID(kTestCases[i].command_id), | 535 menu->GetMenuItemByID(kTestCases[i].command_id), |
| 536 &index, | 536 &index, |
| 537 &count); | 537 &count); |
| 538 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; | 538 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; |
| 539 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; | 539 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; |
| 540 } | 540 } |
| 541 } | 541 } |
| OLD | NEW |