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

Side by Side Diff: chrome/browser/extensions/extension_crash_recovery_browsertest.cc

Issue 12326091: Made notification center notifications collapsed and expandable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, rebase, and rebase again! 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 | 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 "base/process_util.h" 5 #include "base/process_util.h"
6 #include "chrome/browser/browser_process.h" 6 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/extensions/extension_browsertest.h" 7 #include "chrome/browser/extensions/extension_browsertest.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_process_manager.h" 9 #include "chrome/browser/extensions/extension_process_manager.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 #if defined(ENABLE_MESSAGE_CENTER) 118 #if defined(ENABLE_MESSAGE_CENTER)
119 119
120 class MessageCenterExtensionCrashRecoveryTest 120 class MessageCenterExtensionCrashRecoveryTest
121 : public ExtensionCrashRecoveryTestBase { 121 : public ExtensionCrashRecoveryTestBase {
122 protected: 122 protected:
123 virtual void AcceptNotification(size_t index) { 123 virtual void AcceptNotification(size_t index) {
124 message_center::MessageCenter* message_center = 124 message_center::MessageCenter* message_center =
125 message_center::MessageCenter::Get(); 125 message_center::MessageCenter::Get();
126 ASSERT_GT(message_center->NotificationCount(), index); 126 ASSERT_GT(message_center->NotificationCount(), index);
127 message_center::NotificationList::Notifications::reverse_iterator it = 127 message_center::NotificationList::Notifications::reverse_iterator it =
128 message_center->GetNotificationList()->GetNotifications().rbegin(); 128 message_center->notification_list()->GetNotifications().rbegin();
129 for (size_t i=0; i < index; ++i) 129 for (size_t i=0; i < index; ++i)
130 it++; 130 it++;
131 std::string id = (*it)->id(); 131 std::string id = (*it)->id();
132 message_center->OnNotificationClicked(id); 132 message_center->OnClicked(id);
133 WaitForExtensionLoad(); 133 WaitForExtensionLoad();
134 } 134 }
135 135
136 virtual void CancelNotification(size_t index) { 136 virtual void CancelNotification(size_t index) {
137 message_center::MessageCenter* message_center = 137 message_center::MessageCenter* message_center =
138 message_center::MessageCenter::Get(); 138 message_center::MessageCenter::Get();
139 ASSERT_GT(message_center->NotificationCount(), index); 139 ASSERT_GT(message_center->NotificationCount(), index);
140 message_center::NotificationList::Notifications::reverse_iterator it = 140 message_center::NotificationList::Notifications::reverse_iterator it =
141 message_center->GetNotificationList()->GetNotifications().rbegin(); 141 message_center->notification_list()->GetNotifications().rbegin();
142 for (size_t i=0; i < index; i++) { it++; } 142 for (size_t i=0; i < index; i++) { it++; }
143 ASSERT_TRUE( 143 ASSERT_TRUE(
144 g_browser_process->notification_ui_manager()->CancelById((*it)->id())); 144 g_browser_process->notification_ui_manager()->CancelById((*it)->id()));
145 } 145 }
146 146
147 virtual size_t CountBalloons() { 147 virtual size_t CountBalloons() {
148 message_center::MessageCenter* message_center = 148 message_center::MessageCenter* message_center =
149 message_center::MessageCenter::Get(); 149 message_center::MessageCenter::Get();
150 return message_center->NotificationCount(); 150 return message_center->NotificationCount();
151 } 151 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 GetController())); 572 GetController()));
573 chrome::Reload(browser(), CURRENT_TAB); 573 chrome::Reload(browser(), CURRENT_TAB);
574 observer.Wait(); 574 observer.Wait();
575 } 575 }
576 // Extension should now be loaded. 576 // Extension should now be loaded.
577 SCOPED_TRACE("after reloading the tab"); 577 SCOPED_TRACE("after reloading the tab");
578 CheckExtensionConsistency(first_extension_id_); 578 CheckExtensionConsistency(first_extension_id_);
579 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); 579 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size());
580 ASSERT_EQ(0U, CountBalloons()); 580 ASSERT_EQ(0U, CountBalloons());
581 } 581 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698