Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/Notification.cpp

Issue 4904655779790848: Issue 1107.update1 - read Notification properties (title, message and type) on the fly (Closed)
Patch Set: fix style Created Jan. 27, 2015, 1:18 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/Notification.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 TEST_F(NotificationTest, AddNotification) 123 TEST_F(NotificationTest, AddNotification)
124 { 124 {
125 AddNotification("{" 125 AddNotification("{"
126 "type: 'critical'," 126 "type: 'critical',"
127 "title: 'testTitle'," 127 "title: 'testTitle',"
128 "message: 'testMessage'," 128 "message: 'testMessage',"
129 "}"); 129 "}");
130 NotificationPtr notification = filterEngine->GetNextNotificationToShow(); 130 NotificationPtr notification = filterEngine->GetNextNotificationToShow();
131 ASSERT_TRUE(notification); 131 ASSERT_TRUE(notification);
132 EXPECT_EQ(NotificationType::NOTIFICATION_TYPE_CRITICAL, notification->GetType( )); 132 EXPECT_EQ(NotificationType::NOTIFICATION_TYPE_CRITICAL, notification->GetType( ));
133 EXPECT_EQ("testTitle", notification->GetTitle()); 133 EXPECT_EQ("testTitle", notification->GetTexts().title);
134 EXPECT_EQ("testMessage", notification->GetMessageString()); 134 EXPECT_EQ("testMessage", notification->GetTexts().message);
135 } 135 }
136 136
137 TEST_F(NotificationTest, FilterByUrl) 137 TEST_F(NotificationTest, FilterByUrl)
138 { 138 {
139 AddNotification("{ id: 'no-filter', type: 'critical' }"); 139 AddNotification("{ id: 'no-filter', type: 'critical' }");
140 AddNotification("{ id: 'www.com', type: 'information'," 140 AddNotification("{ id: 'www.com', type: 'information',"
141 "urlFilters:['http://www.com']" 141 "urlFilters:['http://www.com']"
142 "}"); 142 "}");
143 AddNotification("{ id: 'www.de', type: 'question'," 143 AddNotification("{ id: 'www.de', type: 'question',"
144 "urlFilters:['http://www.de']" 144 "urlFilters:['http://www.de']"
(...skipping 15 matching lines...) Expand all
160 TEST_F(NotificationTest, MarkAsShown) 160 TEST_F(NotificationTest, MarkAsShown)
161 { 161 {
162 AddNotification("{ id: 'id', type: 'question' }"); 162 AddNotification("{ id: 'id', type: 'question' }");
163 NotificationPtr notification = filterEngine->GetNextNotificationToShow(); 163 NotificationPtr notification = filterEngine->GetNextNotificationToShow();
164 EXPECT_TRUE(notification); 164 EXPECT_TRUE(notification);
165 notification = filterEngine->GetNextNotificationToShow(); 165 notification = filterEngine->GetNextNotificationToShow();
166 ASSERT_TRUE(notification); 166 ASSERT_TRUE(notification);
167 notification->MarkAsShown(); 167 notification->MarkAsShown();
168 EXPECT_EQ(NULL, filterEngine->GetNextNotificationToShow().get()); 168 EXPECT_EQ(NULL, filterEngine->GetNextNotificationToShow().get());
169 } 169 }
OLDNEW
« no previous file with comments | « src/Notification.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld