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

Side by Side Diff: ash/system/tray/system_tray_unittest.cc

Issue 2101263004: mash: Migrate AccessibilityDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 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 "ash/system/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/accessibility_delegate.h" 9 #include "ash/common/accessibility_delegate.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
11 #include "ash/common/system/tray/system_tray_bubble.h" 11 #include "ash/common/system/tray/system_tray_bubble.h"
12 #include "ash/common/system/tray/system_tray_item.h" 12 #include "ash/common/system/tray/system_tray_item.h"
13 #include "ash/common/system/tray/tray_constants.h" 13 #include "ash/common/system/tray/tray_constants.h"
14 #include "ash/common/system/tray/tray_popup_item_container.h" 14 #include "ash/common/system/tray/tray_popup_item_container.h"
15 #include "ash/common/system/web_notification/web_notification_tray.h" 15 #include "ash/common/system/web_notification/web_notification_tray.h"
16 #include "ash/common/wm_shell.h"
16 #include "ash/shell.h" 17 #include "ash/shell.h"
17 #include "ash/system/status_area_widget.h" 18 #include "ash/system/status_area_widget.h"
18 #include "ash/test/ash_test_base.h" 19 #include "ash/test/ash_test_base.h"
19 #include "ash/test/status_area_widget_test_helper.h" 20 #include "ash/test/status_area_widget_test_helper.h"
20 #include "ash/wm/window_util.h" 21 #include "ash/wm/window_util.h"
21 #include "base/run_loop.h" 22 #include "base/run_loop.h"
22 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
23 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
24 #include "ui/base/ui_base_types.h" 25 #include "ui/base/ui_base_types.h"
25 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 26 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 421 }
421 } 422 }
422 423
423 #if defined(OS_CHROMEOS) 424 #if defined(OS_CHROMEOS)
424 // Accessibility/Settings tray items are available only on cros. 425 // Accessibility/Settings tray items are available only on cros.
425 #define MAYBE_WithSystemModal WithSystemModal 426 #define MAYBE_WithSystemModal WithSystemModal
426 #else 427 #else
427 #define MAYBE_WithSystemModal DISABLED_WithSystemModal 428 #define MAYBE_WithSystemModal DISABLED_WithSystemModal
428 #endif 429 #endif
429 TEST_F(SystemTrayTest, MAYBE_WithSystemModal) { 430 TEST_F(SystemTrayTest, MAYBE_WithSystemModal) {
430 // Check if the accessibility item is created even with system modal 431 // Check if the accessibility item is created even with system modal dialog.
431 // dialog. 432 WmShell::Get()->GetAccessibilityDelegate()->SetVirtualKeyboardEnabled(true);
432 Shell::GetInstance()->accessibility_delegate()->SetVirtualKeyboardEnabled(
433 true);
434 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( 433 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
435 new ModalWidgetDelegate(), Shell::GetPrimaryRootWindow(), 434 new ModalWidgetDelegate(), Shell::GetPrimaryRootWindow(),
436 gfx::Rect(0, 0, 100, 100)); 435 gfx::Rect(0, 0, 100, 100));
437 widget->Show(); 436 widget->Show();
438 437
439 SystemTray* tray = GetPrimarySystemTray(); 438 SystemTray* tray = GetPrimarySystemTray();
440 tray->ShowDefaultView(BUBBLE_CREATE_NEW); 439 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
441 440
442 ASSERT_TRUE(tray->HasSystemBubble()); 441 ASSERT_TRUE(tray->HasSystemBubble());
443 const views::View* accessibility = 442 const views::View* accessibility =
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 // Hide the default view, ensure the tray bubble height is back to zero. 546 // Hide the default view, ensure the tray bubble height is back to zero.
548 ASSERT_TRUE(tray->CloseSystemBubble()); 547 ASSERT_TRUE(tray->CloseSystemBubble());
549 RunAllPendingInMessageLoop(); 548 RunAllPendingInMessageLoop();
550 549
551 EXPECT_EQ(0, notification_tray->tray_bubble_height_for_test()); 550 EXPECT_EQ(0, notification_tray->tray_bubble_height_for_test());
552 } 551 }
553 #endif // OS_CHROMEOS 552 #endif // OS_CHROMEOS
554 553
555 } // namespace test 554 } // namespace test
556 } // namespace ash 555 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698