| 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 "chrome/browser/ui/views/message_center/web_notification_tray.h" | 5 #include "chrome/browser/ui/views/message_center/web_notification_tray.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 ~WebNotificationTrayTest() override {} | 40 ~WebNotificationTrayTest() override {} |
| 41 | 41 |
| 42 void TearDownOnMainThread() override { | 42 void TearDownOnMainThread() override { |
| 43 message_center::MessageCenter::Get()->RemoveAllNotifications(false); | 43 message_center::MessageCenter::Get()->RemoveAllNotifications(false); |
| 44 } | 44 } |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 class TestNotificationDelegate : public ::NotificationDelegate { | 47 class TestNotificationDelegate : public ::NotificationDelegate { |
| 48 public: | 48 public: |
| 49 explicit TestNotificationDelegate(std::string id) : id_(id) {} | 49 explicit TestNotificationDelegate(std::string id) : id_(id) {} |
| 50 void Display() override {} | |
| 51 void Error() override {} | |
| 52 void Close(bool by_user) override {} | |
| 53 void Click() override {} | |
| 54 std::string id() const override { return id_; } | 50 std::string id() const override { return id_; } |
| 55 | 51 |
| 56 private: | 52 private: |
| 57 ~TestNotificationDelegate() override {} | 53 ~TestNotificationDelegate() override {} |
| 58 | 54 |
| 59 std::string id_; | 55 std::string id_; |
| 60 }; | 56 }; |
| 61 | 57 |
| 62 void AddNotification(const std::string& delegate_id, | 58 void AddNotification(const std::string& delegate_id, |
| 63 const std::string& replace_id) { | 59 const std::string& replace_id) { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 base::RunLoop().RunUntilIdle(); | 249 base::RunLoop().RunUntilIdle(); |
| 254 EXPECT_TRUE(tray->status_icon_ == NULL); | 250 EXPECT_TRUE(tray->status_icon_ == NULL); |
| 255 AddNotification("test_id", "replace_id"); | 251 AddNotification("test_id", "replace_id"); |
| 256 base::RunLoop().RunUntilIdle(); | 252 base::RunLoop().RunUntilIdle(); |
| 257 EXPECT_TRUE(tray->status_icon_ != NULL); | 253 EXPECT_TRUE(tray->status_icon_ != NULL); |
| 258 RemoveNotification("test_id"); | 254 RemoveNotification("test_id"); |
| 259 base::RunLoop().RunUntilIdle(); | 255 base::RunLoop().RunUntilIdle(); |
| 260 EXPECT_TRUE(tray->status_icon_ == NULL); | 256 EXPECT_TRUE(tray->status_icon_ == NULL); |
| 261 } | 257 } |
| 262 } // namespace message_center | 258 } // namespace message_center |
| OLD | NEW |