| 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 "ui/message_center/message_center_impl.h" | 5 #include "ui/message_center/message_center_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/single_thread_task_runner.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 18 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
| 19 #include "ui/message_center/message_center.h" | 22 #include "ui/message_center/message_center.h" |
| 20 #include "ui/message_center/message_center_types.h" | 23 #include "ui/message_center/message_center_types.h" |
| 21 #include "ui/message_center/notification_blocker.h" | 24 #include "ui/message_center/notification_blocker.h" |
| 22 #include "ui/message_center/notification_types.h" | 25 #include "ui/message_center/notification_types.h" |
| 23 #include "ui/message_center/notifier_settings.h" | 26 #include "ui/message_center/notifier_settings.h" |
| 24 | 27 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 class MockPopupTimersController : public PopupTimersController { | 231 class MockPopupTimersController : public PopupTimersController { |
| 229 public: | 232 public: |
| 230 MockPopupTimersController(MessageCenter* message_center, | 233 MockPopupTimersController(MessageCenter* message_center, |
| 231 base::Closure quit_closure) | 234 base::Closure quit_closure) |
| 232 : PopupTimersController(message_center), | 235 : PopupTimersController(message_center), |
| 233 timer_finished_(false), | 236 timer_finished_(false), |
| 234 quit_closure_(quit_closure) {} | 237 quit_closure_(quit_closure) {} |
| 235 ~MockPopupTimersController() override {} | 238 ~MockPopupTimersController() override {} |
| 236 | 239 |
| 237 void TimerFinished(const std::string& id) override { | 240 void TimerFinished(const std::string& id) override { |
| 238 base::MessageLoop::current()->PostTask(FROM_HERE, quit_closure_); | 241 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure_); |
| 239 timer_finished_ = true; | 242 timer_finished_ = true; |
| 240 last_id_ = id; | 243 last_id_ = id; |
| 241 } | 244 } |
| 242 | 245 |
| 243 bool timer_finished() const { return timer_finished_; } | 246 bool timer_finished() const { return timer_finished_; } |
| 244 const std::string& last_id() const { return last_id_; } | 247 const std::string& last_id() const { return last_id_; } |
| 245 | 248 |
| 246 private: | 249 private: |
| 247 bool timer_finished_; | 250 bool timer_finished_; |
| 248 std::string last_id_; | 251 std::string last_id_; |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 // Then open the message center. | 1168 // Then open the message center. |
| 1166 message_center()->SetVisibility(VISIBILITY_MESSAGE_CENTER); | 1169 message_center()->SetVisibility(VISIBILITY_MESSAGE_CENTER); |
| 1167 | 1170 |
| 1168 // Then update a notification; the update should have propagated. | 1171 // Then update a notification; the update should have propagated. |
| 1169 message_center()->RemoveNotification(id, false); | 1172 message_center()->RemoveNotification(id, false); |
| 1170 EXPECT_FALSE(message_center()->FindVisibleNotificationById(id)); | 1173 EXPECT_FALSE(message_center()->FindVisibleNotificationById(id)); |
| 1171 } | 1174 } |
| 1172 | 1175 |
| 1173 } // namespace internal | 1176 } // namespace internal |
| 1174 } // namespace message_center | 1177 } // namespace message_center |
| OLD | NEW |