| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 g_browser_process->notification_ui_manager(); | 94 g_browser_process->notification_ui_manager(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 FakeMessageCenterTrayDelegate* delegate() { return delegate_; } | 97 FakeMessageCenterTrayDelegate* delegate() { return delegate_; } |
| 98 | 98 |
| 99 MessageCenter* message_center() { return message_center_; } | 99 MessageCenter* message_center() { return message_center_; } |
| 100 | 100 |
| 101 const ::Notification GetANotification(const std::string& id) { | 101 const ::Notification GetANotification(const std::string& id) { |
| 102 return ::Notification( | 102 return ::Notification( |
| 103 GURL("chrome-extension://adflkjsdflkdsfdsflkjdsflkdjfs"), | 103 GURL("chrome-extension://adflkjsdflkdsfdsflkjdsflkdjfs"), |
| 104 GURL(), | 104 gfx::Image(), |
| 105 base::string16(), | 105 base::string16(), |
| 106 base::string16(), | 106 base::string16(), |
| 107 blink::WebTextDirectionDefault, | 107 blink::WebTextDirectionDefault, |
| 108 base::string16(), | 108 base::string16(), |
| 109 base::UTF8ToUTF16(id), | 109 base::UTF8ToUTF16(id), |
| 110 new MockNotificationDelegate(id)); | 110 new MockNotificationDelegate(id)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 base::RunLoop* run_loop() { return run_loop_.get(); } | 113 base::RunLoop* run_loop() { return run_loop_.get(); } |
| 114 PrefService* local_state() { | 114 PrefService* local_state() { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 TestingProfile profile; | 197 TestingProfile profile; |
| 198 notification_manager()->Add(GetANotification("test"), &profile); | 198 notification_manager()->Add(GetANotification("test"), &profile); |
| 199 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); | 199 message_center()->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER); |
| 200 run_loop()->RunUntilIdle(); | 200 run_loop()->RunUntilIdle(); |
| 201 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); | 201 EXPECT_FALSE(notification_manager()->FirstRunTimerIsActive()); |
| 202 EXPECT_FALSE(DidFirstRunPref()); | 202 EXPECT_FALSE(DidFirstRunPref()); |
| 203 } | 203 } |
| 204 | 204 |
| 205 #endif | 205 #endif |
| 206 } // namespace message_center | 206 } // namespace message_center |
| OLD | NEW |