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

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

Issue 12277024: Notificaitons refactor step 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more feedback from Steven Created 7 years, 10 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 | Annotate | Revision Log
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/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
11 #include "ash/system/tray/system_tray_item.h" 11 #include "ash/system/tray/system_tray_item.h"
12 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "ui/message_center/message_center_bubble.h" 15 #include "ui/message_center/message_center_bubble.h"
16 #include "ui/message_center/message_center_tray.h" 16 #include "ui/message_center/message_center_tray.h"
17 #include "ui/message_center/message_popup_bubble.h" 17 #include "ui/message_center/message_popup_bubble.h"
18 #include "ui/message_center/notification_list.h" 18 #include "ui/message_center/notification_list.h"
19 #include "ui/notifications/notification_types.h" 19 #include "ui/message_center/notification_types.h"
20 #include "ui/views/controls/label.h" 20 #include "ui/views/controls/label.h"
21 #include "ui/views/layout/fill_layout.h" 21 #include "ui/views/layout/fill_layout.h"
22 #include "ui/views/view.h" 22 #include "ui/views/view.h"
23 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
24 24
25 #if defined(OS_WIN) 25 #if defined(OS_WIN)
26 #include "base/win/windows_version.h" 26 #include "base/win/windows_version.h"
27 #endif 27 #endif
28 28
29 namespace ash { 29 namespace ash {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 virtual void ShowSettingsDialog(gfx::NativeView context) OVERRIDE { 68 virtual void ShowSettingsDialog(gfx::NativeView context) OVERRIDE {
69 } 69 }
70 70
71 virtual void OnClicked(const std::string& notifcation_id) OVERRIDE { 71 virtual void OnClicked(const std::string& notifcation_id) OVERRIDE {
72 } 72 }
73 73
74 void AddNotification(WebNotificationTray* tray, const std::string& id) { 74 void AddNotification(WebNotificationTray* tray, const std::string& id) {
75 notification_ids_.insert(id); 75 notification_ids_.insert(id);
76 get_message_center()->AddNotification( 76 get_message_center()->AddNotification(
77 ui::notifications::NOTIFICATION_TYPE_SIMPLE, 77 message_center::NOTIFICATION_TYPE_SIMPLE,
78 id, 78 id,
79 ASCIIToUTF16("Test Web Notification"), 79 ASCIIToUTF16("Test Web Notification"),
80 ASCIIToUTF16("Notification message body."), 80 ASCIIToUTF16("Notification message body."),
81 ASCIIToUTF16("www.test.org"), 81 ASCIIToUTF16("www.test.org"),
82 "" /* extension id */, 82 "" /* extension id */,
83 NULL /* optional_fields */); 83 NULL /* optional_fields */);
84 } 84 }
85 85
86 void UpdateNotification(WebNotificationTray* tray, 86 void UpdateNotification(WebNotificationTray* tray,
87 const std::string& old_id, 87 const std::string& old_id,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 EXPECT_TRUE(tray->IsPopupVisible()); 218 EXPECT_TRUE(tray->IsPopupVisible());
219 EXPECT_EQ(notifications_to_add, 219 EXPECT_EQ(notifications_to_add,
220 get_message_center()->NotificationCount()); 220 get_message_center()->NotificationCount());
221 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, 221 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications,
222 tray->GetPopupBubbleForTest()->NumMessageViewsForTest()); 222 tray->GetPopupBubbleForTest()->NumMessageViewsForTest());
223 get_message_center()->SetDelegate(NULL); 223 get_message_center()->SetDelegate(NULL);
224 get_message_center()->notification_list()->RemoveAllNotifications(); 224 get_message_center()->notification_list()->RemoveAllNotifications();
225 } 225 }
226 226
227 } // namespace ash 227 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | chrome/browser/extensions/api/notification/notification_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698