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

Side by Side Diff: ash/system/web_notification/web_notification_tray_unittest.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shelf/shelf_widget.h"
10 #include "ash/system/status_area_widget.h" 11 #include "ash/system/status_area_widget.h"
11 #include "ash/system/tray/system_tray_item.h" 12 #include "ash/system/tray/system_tray_item.h"
12 #include "ash/test/ash_test_base.h" 13 #include "ash/test/ash_test_base.h"
13 #include "base/stringprintf.h" 14 #include "base/stringprintf.h"
14 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
15 #include "ui/message_center/message_center_bubble.h" 16 #include "ui/message_center/message_center_bubble.h"
16 #include "ui/message_center/message_center_tray.h" 17 #include "ui/message_center/message_center_tray.h"
17 #include "ui/message_center/message_popup_bubble.h" 18 #include "ui/message_center/message_popup_bubble.h"
18 #include "ui/message_center/notification_list.h" 19 #include "ui/message_center/notification_list.h"
19 #include "ui/message_center/notification_types.h" 20 #include "ui/message_center/notification_types.h"
20 #include "ui/views/controls/label.h" 21 #include "ui/views/controls/label.h"
21 #include "ui/views/layout/fill_layout.h" 22 #include "ui/views/layout/fill_layout.h"
22 #include "ui/views/view.h" 23 #include "ui/views/view.h"
23 #include "ui/views/widget/widget.h" 24 #include "ui/views/widget/widget.h"
24 25
25 #if defined(OS_WIN) 26 #if defined(OS_WIN)
26 #include "base/win/windows_version.h" 27 #include "base/win/windows_version.h"
27 #endif 28 #endif
28 29
29 namespace ash { 30 namespace ash {
30 31
31 namespace { 32 namespace {
32 33
33 WebNotificationTray* GetWebNotificationTray() { 34 WebNotificationTray* GetWebNotificationTray() {
34 return Shell::GetPrimaryRootWindowController()->status_area_widget()-> 35 return Shell::GetPrimaryRootWindowController()->shelf()->
35 web_notification_tray(); 36 status_area_widget()->web_notification_tray();
36 } 37 }
37 38
38 message_center::MessageCenter* get_message_center() { 39 message_center::MessageCenter* get_message_center() {
39 return GetWebNotificationTray()->message_center(); 40 return GetWebNotificationTray()->message_center();
40 } 41 }
41 42
42 class TestDelegate : public message_center::MessageCenter::Delegate { 43 class TestDelegate : public message_center::MessageCenter::Delegate {
43 public: 44 public:
44 TestDelegate(message_center::MessageCenter* message_center) 45 TestDelegate(message_center::MessageCenter* message_center)
45 : message_center_(message_center) { 46 : message_center_(message_center) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 EXPECT_TRUE(tray->IsPopupVisible()); 220 EXPECT_TRUE(tray->IsPopupVisible());
220 EXPECT_EQ(notifications_to_add, 221 EXPECT_EQ(notifications_to_add,
221 get_message_center()->NotificationCount()); 222 get_message_center()->NotificationCount());
222 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, 223 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications,
223 tray->GetPopupBubbleForTest()->NumMessageViewsForTest()); 224 tray->GetPopupBubbleForTest()->NumMessageViewsForTest());
224 get_message_center()->SetDelegate(NULL); 225 get_message_center()->SetDelegate(NULL);
225 get_message_center()->notification_list()->RemoveAllNotifications(); 226 get_message_center()->notification_list()->RemoveAllNotifications();
226 } 227 }
227 228
228 } // namespace ash 229 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698