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 20 matching lines...) Expand all Loading... |
31 displayed_first_run_balloon_(false) {} | 31 displayed_first_run_balloon_(false) {} |
32 | 32 |
33 virtual void DisplayFirstRunBalloon() OVERRIDE { | 33 virtual void DisplayFirstRunBalloon() OVERRIDE { |
34 displayed_first_run_balloon_ = true; | 34 displayed_first_run_balloon_ = true; |
35 base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_); | 35 base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_); |
36 } | 36 } |
37 | 37 |
38 virtual void OnMessageCenterTrayChanged() OVERRIDE {} | 38 virtual void OnMessageCenterTrayChanged() OVERRIDE {} |
39 virtual bool ShowPopups() OVERRIDE { return true; } | 39 virtual bool ShowPopups() OVERRIDE { return true; } |
40 virtual void HidePopups() OVERRIDE {} | 40 virtual void HidePopups() OVERRIDE {} |
41 virtual void UpdatePopups() OVERRIDE {} | |
42 virtual bool ShowMessageCenter() OVERRIDE { return true; } | 41 virtual bool ShowMessageCenter() OVERRIDE { return true; } |
43 virtual bool ShowNotifierSettings() OVERRIDE { return true; } | 42 virtual bool ShowNotifierSettings() OVERRIDE { return true; } |
44 virtual void HideMessageCenter() OVERRIDE {} | 43 virtual void HideMessageCenter() OVERRIDE {} |
45 | 44 |
46 bool displayed_first_run_balloon() const { | 45 bool displayed_first_run_balloon() const { |
47 return displayed_first_run_balloon_; | 46 return displayed_first_run_balloon_; |
48 } | 47 } |
49 private: | 48 private: |
50 MessageCenterTray tray_; | 49 MessageCenterTray tray_; |
51 base::Closure quit_closure_; | 50 base::Closure quit_closure_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 TEST_F(MessageCenterNotificationManagerTest, | 149 TEST_F(MessageCenterNotificationManagerTest, |
151 FirstRunNotShownWithMessageCenter) { | 150 FirstRunNotShownWithMessageCenter) { |
152 TestingProfile profile; | 151 TestingProfile profile; |
153 notification_manager()->Add(GetANotification("test"), &profile); | 152 notification_manager()->Add(GetANotification("test"), &profile); |
154 message_center()->SetMessageCenterVisible(true); | 153 message_center()->SetMessageCenterVisible(true); |
155 run_loop()->RunUntilIdle(); | 154 run_loop()->RunUntilIdle(); |
156 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); | 155 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); |
157 EXPECT_FALSE(DidFirstRunPref()); | 156 EXPECT_FALSE(DidFirstRunPref()); |
158 } | 157 } |
159 } // namespace message_center | 158 } // namespace message_center |
OLD | NEW |