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

Side by Side Diff: chrome/browser/background/background_contents_service_unittest.cc

Issue 2776933006: CrOS: Do not allow notifications to be added during shutdown. (Closed)
Patch Set: Trybots. Created 3 years, 8 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 | « no previous file | chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc » ('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 "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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/hats/hats_notification_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698