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

Side by Side Diff: chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc

Issue 414203002: Modified tab change to work with status tray change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit fix Created 6 years, 4 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
« no previous file with comments | « chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 window->GetRootView()->NotifyAccessibilityEvent( 417 window->GetRootView()->NotifyAccessibilityEvent(
418 ui::AX_EVENT_ALERT, true); 418 ui::AX_EVENT_ALERT, true);
419 base::MessageLoop::current()->RunUntilIdle(); 419 base::MessageLoop::current()->RunUntilIdle();
420 420
421 EXPECT_EQ(1, control_event_count_); 421 EXPECT_EQ(1, control_event_count_);
422 EXPECT_EQ(kTypeWindow, last_control_type_); 422 EXPECT_EQ(kTypeWindow, last_control_type_);
423 423
424 window->CloseNow(); 424 window->CloseNow();
425 } 425 }
426 426
427 TEST_F(AccessibilityEventRouterViewsTest, AccessibilityFocusableView) {
428 // Create a view with a child view.
429 views::View* parent = new views::View();
430 views::View* child = new views::View();
431 parent->AddChildView(child);
432
433 // Put the view in a window.
434 views::Widget* window = CreateWindowWithContents(parent);
435
436 // Since the child view has no accessiblity focusable ancestors, this
437 // should still be the child view.
438 views::View* accessible_view =
439 AccessibilityEventRouterViews::FindFirstAccessibleAncestor(child);
440 EXPECT_EQ(accessible_view, child);
441
442 // Now make the parent view accessiblity focusable. Calling
443 // FindFirstAccessibleAncestor() again on child shoudl return the parent
444 // view.
445 parent->SetAccessibilityFocusable(true);
446 accessible_view =
447 AccessibilityEventRouterViews::FindFirstAccessibleAncestor(child);
448 EXPECT_EQ(accessible_view, parent);
449
450 window->CloseNow();
451 }
452
427 namespace { 453 namespace {
428 454
429 class SimpleMenuDelegate : public ui::SimpleMenuModel::Delegate { 455 class SimpleMenuDelegate : public ui::SimpleMenuModel::Delegate {
430 public: 456 public:
431 enum { 457 enum {
432 IDC_MENU_ITEM_1, 458 IDC_MENU_ITEM_1,
433 IDC_MENU_ITEM_2, 459 IDC_MENU_ITEM_2,
434 IDC_MENU_INVISIBLE, 460 IDC_MENU_INVISIBLE,
435 IDC_MENU_ITEM_3, 461 IDC_MENU_ITEM_3,
436 }; 462 };
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 532
507 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( 533 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount(
508 menu_container, 534 menu_container,
509 menu->GetMenuItemByID(kTestCases[i].command_id), 535 menu->GetMenuItemByID(kTestCases[i].command_id),
510 &index, 536 &index,
511 &count); 537 &count);
512 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; 538 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i;
513 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; 539 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i;
514 } 540 }
515 } 541 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698