| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #import "chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h" | 5 #import "chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ui::CocoaTest::TearDown(); | 39 ui::CocoaTest::TearDown(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 MCStatusItemView* status_item() { return bridge_->status_item_view_.get(); } | 42 MCStatusItemView* status_item() { return bridge_->status_item_view_.get(); } |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 scoped_ptr<message_center::Notification> GetNotification() { | 45 scoped_ptr<message_center::Notification> GetNotification() { |
| 46 message_center::RichNotificationData data; | 46 message_center::RichNotificationData data; |
| 47 data.priority = -1; | 47 data.priority = -1; |
| 48 return make_scoped_ptr(new message_center::Notification( | 48 return make_scoped_ptr(new message_center::Notification( |
| 49 message_center::NOTIFICATION_TYPE_SIMPLE, | 49 message_center::NOTIFICATION_TYPE_SIMPLE, "1", |
| 50 "1", | |
| 51 base::ASCIIToUTF16("First notification"), | 50 base::ASCIIToUTF16("First notification"), |
| 52 base::ASCIIToUTF16("This is a simple test."), | 51 base::ASCIIToUTF16("This is a simple test."), gfx::Image(), |
| 53 gfx::Image(), | 52 base::string16(), GURL(), message_center::NotifierId(), data, NULL)); |
| 54 base::string16(), | |
| 55 message_center::NotifierId(), | |
| 56 data, | |
| 57 NULL)); | |
| 58 } | 53 } |
| 59 | 54 |
| 60 TestingPrefServiceSimple* local_state() { return local_state_->Get(); } | 55 TestingPrefServiceSimple* local_state() { return local_state_->Get(); } |
| 61 | 56 |
| 62 scoped_ptr<TestingBrowserProcessInitializer> initializer_; | 57 scoped_ptr<TestingBrowserProcessInitializer> initializer_; |
| 63 scoped_ptr<ScopedTestingLocalState> local_state_; | 58 scoped_ptr<ScopedTestingLocalState> local_state_; |
| 64 | 59 |
| 65 base::MessageLoop message_loop_; | 60 base::MessageLoop message_loop_; |
| 66 message_center::MessageCenter* center_; // Weak, global. | 61 message_center::MessageCenter* center_; // Weak, global. |
| 67 scoped_ptr<MessageCenterTrayBridge> bridge_; | 62 scoped_ptr<MessageCenterTrayBridge> bridge_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 center_->RemoveNotification("1", /*by_user=*/true); | 141 center_->RemoveNotification("1", /*by_user=*/true); |
| 147 | 142 |
| 148 base::RunLoop().RunUntilIdle(); | 143 base::RunLoop().RunUntilIdle(); |
| 149 | 144 |
| 150 EXPECT_FALSE(status_item()); | 145 EXPECT_FALSE(status_item()); |
| 151 | 146 |
| 152 local_state()->SetBoolean(prefs::kMessageCenterShowIcon, true); | 147 local_state()->SetBoolean(prefs::kMessageCenterShowIcon, true); |
| 153 | 148 |
| 154 EXPECT_TRUE(status_item()); | 149 EXPECT_TRUE(status_item()); |
| 155 } | 150 } |
| OLD | NEW |