OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 }; | 119 }; |
120 } | 120 } |
121 | 121 |
122 TEST_F(NotificationTest, NoNotifications) | 122 TEST_F(NotificationTest, NoNotifications) |
123 { | 123 { |
124 EXPECT_FALSE(PeekNotification()); | 124 EXPECT_FALSE(PeekNotification()); |
125 } | 125 } |
126 | 126 |
127 TEST_F(NotificationMockWebRequestTest, DISABLED_SingleNotification) | 127 TEST_F(NotificationMockWebRequestTest, DISABLED_SingleNotification) |
128 { | 128 { |
129 AdblockPlus::Sleep(5000/*msec*/); // it's a hack | 129 std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // it's a hack |
130 EXPECT_TRUE(isNotificationCallbackCalled); | 130 EXPECT_TRUE(isNotificationCallbackCalled); |
131 } | 131 } |
132 | 132 |
133 TEST_F(NotificationTest, AddNotification) | 133 TEST_F(NotificationTest, AddNotification) |
134 { | 134 { |
135 AddNotification("{" | 135 AddNotification("{" |
136 "type: 'critical'," | 136 "type: 'critical'," |
137 "title: 'testTitle'," | 137 "title: 'testTitle'," |
138 "message: 'testMessage'," | 138 "message: 'testMessage'," |
139 "}"); | 139 "}"); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 TEST_F(NotificationTest, Links) | 188 TEST_F(NotificationTest, Links) |
189 { | 189 { |
190 AddNotification("{ id: 'id', links: ['link1', 'link2'] }"); | 190 AddNotification("{ id: 'id', links: ['link1', 'link2'] }"); |
191 auto notification = PeekNotification(); | 191 auto notification = PeekNotification(); |
192 ASSERT_TRUE(notification); | 192 ASSERT_TRUE(notification); |
193 std::vector<std::string> notificationLinks = notification->GetLinks(); | 193 std::vector<std::string> notificationLinks = notification->GetLinks(); |
194 ASSERT_EQ(2u, notificationLinks.size()); | 194 ASSERT_EQ(2u, notificationLinks.size()); |
195 EXPECT_EQ("link1", notificationLinks[0]); | 195 EXPECT_EQ("link1", notificationLinks[0]); |
196 EXPECT_EQ("link2", notificationLinks[1]); | 196 EXPECT_EQ("link2", notificationLinks[1]); |
197 } | 197 } |
OLD | NEW |