| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 class MessageCenterImplTest : public testing::Test, | 24 class MessageCenterImplTest : public testing::Test, |
| 25 public MessageCenterObserver { | 25 public MessageCenterObserver { |
| 26 public: | 26 public: |
| 27 MessageCenterImplTest() {} | 27 MessageCenterImplTest() {} |
| 28 | 28 |
| 29 virtual void SetUp() OVERRIDE { | 29 virtual void SetUp() OVERRIDE { |
| 30 MessageCenter::Initialize(); | 30 MessageCenter::Initialize(); |
| 31 message_center_ = MessageCenter::Get(); | 31 message_center_ = MessageCenter::Get(); |
| 32 loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT)); | 32 loop_.reset(new base::MessageLoop); |
| 33 run_loop_.reset(new base::RunLoop()); | 33 run_loop_.reset(new base::RunLoop()); |
| 34 closure_ = run_loop_->QuitClosure(); | 34 closure_ = run_loop_->QuitClosure(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual void TearDown() OVERRIDE { | 37 virtual void TearDown() OVERRIDE { |
| 38 run_loop_.reset(); | 38 run_loop_.reset(); |
| 39 loop_.reset(); | 39 loop_.reset(); |
| 40 message_center_ = NULL; | 40 message_center_ = NULL; |
| 41 MessageCenter::Shutdown(); | 41 MessageCenter::Shutdown(); |
| 42 } | 42 } |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 } | 755 } |
| 756 EXPECT_EQ(3u, message_center()->UnreadNotificationCount()); | 756 EXPECT_EQ(3u, message_center()->UnreadNotificationCount()); |
| 757 | 757 |
| 758 // Opening the message center will reset the unread count. | 758 // Opening the message center will reset the unread count. |
| 759 message_center()->SetVisibility(VISIBILITY_MESSAGE_CENTER); | 759 message_center()->SetVisibility(VISIBILITY_MESSAGE_CENTER); |
| 760 EXPECT_EQ(0u, message_center()->UnreadNotificationCount()); | 760 EXPECT_EQ(0u, message_center()->UnreadNotificationCount()); |
| 761 } | 761 } |
| 762 | 762 |
| 763 } // namespace internal | 763 } // namespace internal |
| 764 } // namespace message_center | 764 } // namespace message_center |
| OLD | NEW |