OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/prefs/testing_pref_service.h" | 6 #include "base/prefs/testing_pref_service.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/notifications/message_center_notification_manager.h" | 10 #include "chrome/browser/notifications/message_center_notification_manager.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual void DisplayFirstRunBalloon() OVERRIDE { | 36 virtual void DisplayFirstRunBalloon() OVERRIDE { |
37 displayed_first_run_balloon_ = true; | 37 displayed_first_run_balloon_ = true; |
38 base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_); | 38 base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_); |
39 } | 39 } |
40 | 40 |
41 virtual void OnMessageCenterTrayChanged() OVERRIDE {} | 41 virtual void OnMessageCenterTrayChanged() OVERRIDE {} |
42 virtual bool ShowPopups() OVERRIDE { return true; } | 42 virtual bool ShowPopups() OVERRIDE { return true; } |
43 virtual void HidePopups() OVERRIDE {} | 43 virtual void HidePopups() OVERRIDE {} |
44 virtual bool ShowMessageCenter() OVERRIDE { return true; } | 44 virtual bool ShowMessageCenter() OVERRIDE { return true; } |
45 virtual bool ShowNotifierSettings() OVERRIDE { return true; } | 45 virtual bool ShowNotifierSettings() OVERRIDE { return true; } |
| 46 virtual bool IsContextMenuEnabled() const OVERRIDE { return true; } |
46 virtual void HideMessageCenter() OVERRIDE {} | 47 virtual void HideMessageCenter() OVERRIDE {} |
47 virtual MessageCenterTray* GetMessageCenterTray() OVERRIDE { | 48 virtual MessageCenterTray* GetMessageCenterTray() OVERRIDE { |
48 return &tray_; | 49 return &tray_; |
49 } | 50 } |
50 | 51 |
51 bool displayed_first_run_balloon() const { | 52 bool displayed_first_run_balloon() const { |
52 return displayed_first_run_balloon_; | 53 return displayed_first_run_balloon_; |
53 } | 54 } |
54 private: | 55 private: |
55 MessageCenterTray tray_; | 56 MessageCenterTray tray_; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 TEST_F(MessageCenterNotificationManagerTest, | 159 TEST_F(MessageCenterNotificationManagerTest, |
159 FirstRunNotShownWithMessageCenter) { | 160 FirstRunNotShownWithMessageCenter) { |
160 TestingProfile profile; | 161 TestingProfile profile; |
161 notification_manager()->Add(GetANotification("test"), &profile); | 162 notification_manager()->Add(GetANotification("test"), &profile); |
162 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); | 163 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); |
163 run_loop()->RunUntilIdle(); | 164 run_loop()->RunUntilIdle(); |
164 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); | 165 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); |
165 EXPECT_FALSE(DidFirstRunPref()); | 166 EXPECT_FALSE(DidFirstRunPref()); |
166 } | 167 } |
167 } // namespace message_center | 168 } // namespace message_center |
OLD | NEW |