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

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

Issue 2099603002: Reland: mash: Convert TrayBackgroundView to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix conflict Created 4 years, 6 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 | « ash/system/tray/system_tray_bubble.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | 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 "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/system/tray/system_tray_bubble.h"
10 #include "ash/common/system/tray/system_tray_item.h" 11 #include "ash/common/system/tray/system_tray_item.h"
11 #include "ash/common/system/tray/tray_constants.h" 12 #include "ash/common/system/tray/tray_constants.h"
12 #include "ash/common/system/tray/tray_popup_item_container.h" 13 #include "ash/common/system/tray/tray_popup_item_container.h"
13 #include "ash/shelf/shelf.h" 14 #include "ash/shelf/shelf.h"
14 #include "ash/shell.h" 15 #include "ash/shell.h"
15 #include "ash/system/status_area_widget.h" 16 #include "ash/system/status_area_widget.h"
16 #include "ash/system/tray/system_tray_bubble.h"
17 #include "ash/system/web_notification/web_notification_tray.h" 17 #include "ash/system/web_notification/web_notification_tray.h"
18 #include "ash/test/ash_test_base.h" 18 #include "ash/test/ash_test_base.h"
19 #include "ash/test/status_area_widget_test_helper.h" 19 #include "ash/test/status_area_widget_test_helper.h"
20 #include "ash/wm/window_util.h" 20 #include "ash/wm/window_util.h"
21 #include "base/run_loop.h" 21 #include "base/run_loop.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
24 #include "ui/base/ui_base_types.h" 24 #include "ui/base/ui_base_types.h"
25 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 25 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
26 #include "ui/events/test/event_generator.h" 26 #include "ui/events/test/event_generator.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 EXPECT_FALSE(view->active()); 527 EXPECT_FALSE(view->active());
528 528
529 generator.set_current_location(move_point); 529 generator.set_current_location(move_point);
530 generator.ReleaseTouch(); 530 generator.ReleaseTouch();
531 EXPECT_FALSE(view->active()); 531 EXPECT_FALSE(view->active());
532 } 532 }
533 533
534 TEST_F(SystemTrayTest, SystemTrayHeightWithBubble) { 534 TEST_F(SystemTrayTest, SystemTrayHeightWithBubble) {
535 SystemTray* tray = GetPrimarySystemTray(); 535 SystemTray* tray = GetPrimarySystemTray();
536 WebNotificationTray* notification_tray = 536 WebNotificationTray* notification_tray =
537 tray->status_area_widget()->web_notification_tray(); 537 StatusAreaWidgetTestHelper::GetStatusAreaWidget()
538 ->web_notification_tray();
538 539
539 // Ensure the initial system tray height is zero. 540 // Ensure the initial system tray height is zero.
540 EXPECT_EQ(0, notification_tray->system_tray_height_for_test()); 541 EXPECT_EQ(0, notification_tray->system_tray_height_for_test());
541 542
542 // Show the default view, ensure the system tray height is changed. 543 // Show the default view, ensure the system tray height is changed.
543 tray->ShowDefaultView(BUBBLE_CREATE_NEW); 544 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
544 RunAllPendingInMessageLoop(); 545 RunAllPendingInMessageLoop();
545 EXPECT_LT(0, notification_tray->system_tray_height_for_test()); 546 EXPECT_LT(0, notification_tray->system_tray_height_for_test());
546 547
547 // Hide the default view, ensure the system tray height is back to zero. 548 // Hide the default view, ensure the system tray height is back to zero.
548 ASSERT_TRUE(tray->CloseSystemBubble()); 549 ASSERT_TRUE(tray->CloseSystemBubble());
549 RunAllPendingInMessageLoop(); 550 RunAllPendingInMessageLoop();
550 551
551 EXPECT_EQ(0, notification_tray->system_tray_height_for_test()); 552 EXPECT_EQ(0, notification_tray->system_tray_height_for_test());
552 } 553 }
553 #endif // OS_CHROMEOS 554 #endif // OS_CHROMEOS
554 555
555 } // namespace test 556 } // namespace test
556 } // namespace ash 557 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_bubble.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698