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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 const char kOldNameASCII[] = "OldName"; | 322 const char kOldNameASCII[] = "OldName"; |
323 const char kNewNameASCII[] = "NewName"; | 323 const char kNewNameASCII[] = "NewName"; |
324 | 324 |
325 // Create a toolbar with a button. | 325 // Create a toolbar with a button. |
326 views::View* contents = new ViewWithNameAndRole( | 326 views::View* contents = new ViewWithNameAndRole( |
327 ASCIIToUTF16(kContentsNameASCII), | 327 ASCIIToUTF16(kContentsNameASCII), |
328 ui::AccessibilityTypes::ROLE_CLIENT); | 328 ui::AccessibilityTypes::ROLE_CLIENT); |
329 ViewWithNameAndRole* child = new ViewWithNameAndRole( | 329 ViewWithNameAndRole* child = new ViewWithNameAndRole( |
330 ASCIIToUTF16(kOldNameASCII), | 330 ASCIIToUTF16(kOldNameASCII), |
331 ui::AccessibilityTypes::ROLE_PUSHBUTTON); | 331 ui::AccessibilityTypes::ROLE_PUSHBUTTON); |
332 child->set_focusable(true); | 332 child->SetFocusable(true); |
333 contents->AddChildView(child); | 333 contents->AddChildView(child); |
334 | 334 |
335 // Put the view in a window. | 335 // Put the view in a window. |
336 views::Widget* window = CreateWindowWithContents(contents); | 336 views::Widget* window = CreateWindowWithContents(contents); |
337 | 337 |
338 // Set focus to the child view. | 338 // Set focus to the child view. |
339 control_event_count_ = 0; | 339 control_event_count_ = 0; |
340 child->RequestFocus(); | 340 child->RequestFocus(); |
341 | 341 |
342 // Change the child's name after the focus notification. | 342 // Change the child's name after the focus notification. |
(...skipping 15 matching lines...) Expand all Loading... |
358 const char kContentsNameASCII[] = "Contents"; | 358 const char kContentsNameASCII[] = "Contents"; |
359 const char kNameASCII[] = "OldName"; | 359 const char kNameASCII[] = "OldName"; |
360 | 360 |
361 // Create a toolbar with a button. | 361 // Create a toolbar with a button. |
362 views::View* contents = new ViewWithNameAndRole( | 362 views::View* contents = new ViewWithNameAndRole( |
363 ASCIIToUTF16(kContentsNameASCII), | 363 ASCIIToUTF16(kContentsNameASCII), |
364 ui::AccessibilityTypes::ROLE_CLIENT); | 364 ui::AccessibilityTypes::ROLE_CLIENT); |
365 ViewWithNameAndRole* child = new ViewWithNameAndRole( | 365 ViewWithNameAndRole* child = new ViewWithNameAndRole( |
366 ASCIIToUTF16(kNameASCII), | 366 ASCIIToUTF16(kNameASCII), |
367 ui::AccessibilityTypes::ROLE_PUSHBUTTON); | 367 ui::AccessibilityTypes::ROLE_PUSHBUTTON); |
368 child->set_focusable(true); | 368 child->SetFocusable(true); |
369 contents->AddChildView(child); | 369 contents->AddChildView(child); |
370 | 370 |
371 // Put the view in a window. | 371 // Put the view in a window. |
372 views::Widget* window = CreateWindowWithContents(contents); | 372 views::Widget* window = CreateWindowWithContents(contents); |
373 | 373 |
374 // Set focus to the child view. | 374 // Set focus to the child view. |
375 control_event_count_ = 0; | 375 control_event_count_ = 0; |
376 child->RequestFocus(); | 376 child->RequestFocus(); |
377 | 377 |
378 // Delete the child! | 378 // Delete the child! |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( | 506 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( |
507 menu_container, | 507 menu_container, |
508 menu->GetMenuItemByID(kTestCases[i].command_id), | 508 menu->GetMenuItemByID(kTestCases[i].command_id), |
509 &index, | 509 &index, |
510 &count); | 510 &count); |
511 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; | 511 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; |
512 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; | 512 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; |
513 } | 513 } |
514 } | 514 } |
OLD | NEW |