OLD | NEW |
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 "chrome/browser/background/background_contents_service.h" | 5 #include "chrome/browser/background/background_contents_service.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 ASSERT_TRUE(profile_manager_->SetUp()); | 186 ASSERT_TRUE(profile_manager_->SetUp()); |
187 MessageCenterNotificationManager* manager = | 187 MessageCenterNotificationManager* manager = |
188 static_cast<MessageCenterNotificationManager*>( | 188 static_cast<MessageCenterNotificationManager*>( |
189 g_browser_process->notification_ui_manager()); | 189 g_browser_process->notification_ui_manager()); |
190 manager->SetMessageCenterTrayDelegateForTest( | 190 manager->SetMessageCenterTrayDelegateForTest( |
191 new message_center::FakeMessageCenterTrayDelegate( | 191 new message_center::FakeMessageCenterTrayDelegate( |
192 message_center::MessageCenter::Get())); | 192 message_center::MessageCenter::Get())); |
193 } | 193 } |
194 | 194 |
195 void TearDown() override { | 195 void TearDown() override { |
196 g_browser_process->notification_ui_manager()->CancelAll(); | 196 g_browser_process->notification_ui_manager()->StartShutdown(); |
197 profile_manager_.reset(); | 197 profile_manager_.reset(); |
198 #if !defined(OS_CHROMEOS) | 198 #if !defined(OS_CHROMEOS) |
199 message_center::MessageCenter::Shutdown(); | 199 message_center::MessageCenter::Shutdown(); |
200 #endif | 200 #endif |
201 BrowserWithTestWindowTest::TearDown(); | 201 BrowserWithTestWindowTest::TearDown(); |
202 } | 202 } |
203 | 203 |
204 protected: | 204 protected: |
205 // Creates crash notification for the specified extension and returns | 205 // Creates crash notification for the specified extension and returns |
206 // the created one. | 206 // the created one. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 ASSERT_TRUE(extension.get()); | 407 ASSERT_TRUE(extension.get()); |
408 CreateCrashNotification(extension); | 408 CreateCrashNotification(extension); |
409 CreateCrashNotification(extension); | 409 CreateCrashNotification(extension); |
410 | 410 |
411 message_center::MessageCenter* message_center = | 411 message_center::MessageCenter* message_center = |
412 message_center::MessageCenter::Get(); | 412 message_center::MessageCenter::Get(); |
413 message_center::NotificationList::Notifications notifications = | 413 message_center::NotificationList::Notifications notifications = |
414 message_center->GetVisibleNotifications(); | 414 message_center->GetVisibleNotifications(); |
415 ASSERT_EQ(1u, notifications.size()); | 415 ASSERT_EQ(1u, notifications.size()); |
416 } | 416 } |
OLD | NEW |