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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace message_center { | 33 namespace message_center { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 class WebNotificationTrayTest : public InProcessBrowserTest { | 37 class WebNotificationTrayTest : public InProcessBrowserTest { |
38 public: | 38 public: |
39 WebNotificationTrayTest() {} | 39 WebNotificationTrayTest() {} |
40 virtual ~WebNotificationTrayTest() {} | 40 virtual ~WebNotificationTrayTest() {} |
41 | 41 |
42 virtual void TearDownOnMainThread() OVERRIDE { | 42 virtual 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 virtual void Display() OVERRIDE {} | 50 virtual void Display() override {} |
51 virtual void Error() OVERRIDE {} | 51 virtual void Error() override {} |
52 virtual void Close(bool by_user) OVERRIDE {} | 52 virtual void Close(bool by_user) override {} |
53 virtual void Click() OVERRIDE {} | 53 virtual void Click() override {} |
54 virtual std::string id() const OVERRIDE { return id_; } | 54 virtual std::string id() const override { return id_; } |
55 virtual content::WebContents* GetWebContents() const OVERRIDE { | 55 virtual content::WebContents* GetWebContents() const override { |
56 return NULL; | 56 return NULL; |
57 } | 57 } |
58 | 58 |
59 private: | 59 private: |
60 virtual ~TestNotificationDelegate() {} | 60 virtual ~TestNotificationDelegate() {} |
61 | 61 |
62 std::string id_; | 62 std::string id_; |
63 }; | 63 }; |
64 | 64 |
65 void AddNotification(const std::string& id, const std::string& replace_id) { | 65 void AddNotification(const std::string& id, const std::string& replace_id) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 base::RunLoop().RunUntilIdle(); | 245 base::RunLoop().RunUntilIdle(); |
246 EXPECT_TRUE(tray->status_icon_ == NULL); | 246 EXPECT_TRUE(tray->status_icon_ == NULL); |
247 AddNotification("test_id", "replace_id"); | 247 AddNotification("test_id", "replace_id"); |
248 base::RunLoop().RunUntilIdle(); | 248 base::RunLoop().RunUntilIdle(); |
249 EXPECT_TRUE(tray->status_icon_ != NULL); | 249 EXPECT_TRUE(tray->status_icon_ != NULL); |
250 RemoveNotification("test_id"); | 250 RemoveNotification("test_id"); |
251 base::RunLoop().RunUntilIdle(); | 251 base::RunLoop().RunUntilIdle(); |
252 EXPECT_TRUE(tray->status_icon_ == NULL); | 252 EXPECT_TRUE(tray->status_icon_ == NULL); |
253 } | 253 } |
254 } // namespace message_center | 254 } // namespace message_center |
OLD | NEW |