OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 void AllowOrigin(const GURL& origin) { | 85 void AllowOrigin(const GURL& origin) { |
86 service_->GrantPermission(origin); | 86 service_->GrantPermission(origin); |
87 } | 87 } |
88 | 88 |
89 void DenyOrigin(const GURL& origin) { | 89 void DenyOrigin(const GURL& origin) { |
90 service_->DenyPermission(origin); | 90 service_->DenyPermission(origin); |
91 } | 91 } |
92 | 92 |
93 // Constructs a notification parameter structure for use in tests. | 93 // Constructs a notification parameter structure for use in tests. |
94 DesktopNotificationHostMsg_Show_Params StandardTestNotification(); | 94 content::ShowDesktopNotificationHostMsgParams StandardTestNotification(); |
95 | 95 |
96 // Create a message loop to allow notifications code to post tasks, | 96 // Create a message loop to allow notifications code to post tasks, |
97 // and a thread so that notifications code runs on the expected thread. | 97 // and a thread so that notifications code runs on the expected thread. |
98 MessageLoopForUI message_loop_; | 98 MessageLoopForUI message_loop_; |
99 content::TestBrowserThread ui_thread_; | 99 content::TestBrowserThread ui_thread_; |
100 | 100 |
101 // Local state mock. | 101 // Local state mock. |
102 TestingPrefService local_state_; | 102 TestingPrefService local_state_; |
103 | 103 |
104 // Test profile. | 104 // Test profile. |
105 scoped_ptr<TestingProfile> profile_; | 105 scoped_ptr<TestingProfile> profile_; |
106 | 106 |
107 // Mock balloon collection -- owned by the NotificationUIManager | 107 // Mock balloon collection -- owned by the NotificationUIManager |
108 MockBalloonCollection* balloon_collection_; | 108 MockBalloonCollection* balloon_collection_; |
109 | 109 |
110 // Real UI manager. | 110 // Real UI manager. |
111 scoped_ptr<NotificationUIManager> ui_manager_; | 111 scoped_ptr<NotificationUIManager> ui_manager_; |
112 | 112 |
113 // Real DesktopNotificationService | 113 // Real DesktopNotificationService |
114 scoped_ptr<DesktopNotificationService> service_; | 114 scoped_ptr<DesktopNotificationService> service_; |
115 | 115 |
116 // Contains the cumulative output of the unit test. | 116 // Contains the cumulative output of the unit test. |
117 static std::string log_output_; | 117 static std::string log_output_; |
118 }; | 118 }; |
119 | 119 |
120 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ | 120 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATIONS_UNITTEST_H_ |
OLD | NEW |