Chromium Code Reviews| Index: content/child/notifications/pending_notifications_tracker_unittest.cc |
| diff --git a/content/child/notifications/pending_notifications_tracker_unittest.cc b/content/child/notifications/pending_notifications_tracker_unittest.cc |
| index 18cee87f20f06a09c42922ee95b6a6b17c3e8690..10846172052ec3a2c22dd4c0c5748e5dfd996e69 100644 |
| --- a/content/child/notifications/pending_notifications_tracker_unittest.cc |
| +++ b/content/child/notifications/pending_notifications_tracker_unittest.cc |
| @@ -37,6 +37,7 @@ namespace content { |
| namespace { |
| const char kBaseUrl[] = "http://test.com/"; |
| +const char kIcon48x48[] = "48x48.png"; |
| const char kIcon100x100[] = "100x100.png"; |
| const char kIcon110x110[] = "110x110.png"; |
| const char kIcon120x120[] = "120x120.png"; |
| @@ -141,6 +142,7 @@ class PendingNotificationsTrackerTest : public testing::Test { |
| TEST_F(PendingNotificationsTrackerTest, OneNotificationMultipleResources) { |
| blink::WebNotificationData notification_data; |
| notification_data.icon = RegisterMockedURL(kIcon100x100); |
| + notification_data.smallIcon = RegisterMockedURL(kIcon48x48); |
| notification_data.actions = |
| blink::WebVector<blink::WebNotificationAction>(static_cast<size_t>(2)); |
| notification_data.actions[0].icon = RegisterMockedURL(kIcon110x110); |
| @@ -163,6 +165,9 @@ TEST_F(PendingNotificationsTrackerTest, OneNotificationMultipleResources) { |
| ASSERT_FALSE(GetResources(0u)->notification_icon.drawsNothing()); |
| ASSERT_EQ(100, GetResources(0u)->notification_icon.width()); |
| + ASSERT_FALSE(GetResources(0u)->small_icon.drawsNothing()); |
|
Peter Beverloo
2016/03/03 17:55:39
nit: would it make sense to have the following in
Michael van Ouwerkerk
2016/03/09 18:28:25
Done.
|
| + ASSERT_EQ(48, GetResources(0u)->small_icon.width()); |
| + |
| ASSERT_EQ(2u, GetResources(0u)->action_icons.size()); |
| ASSERT_FALSE(GetResources(0u)->action_icons[0].drawsNothing()); |
| ASSERT_EQ(110, GetResources(0u)->action_icons[0].width()); |
| @@ -173,6 +178,7 @@ TEST_F(PendingNotificationsTrackerTest, OneNotificationMultipleResources) { |
| TEST_F(PendingNotificationsTrackerTest, LargeIconsAreScaledDown) { |
| blink::WebNotificationData notification_data; |
| notification_data.icon = RegisterMockedURL(kIcon500x500); |
| + notification_data.smallIcon = notification_data.icon; |
| notification_data.actions = |
| blink::WebVector<blink::WebNotificationAction>(static_cast<size_t>(1)); |
| notification_data.actions[0].icon = notification_data.icon; |
| @@ -197,6 +203,12 @@ TEST_F(PendingNotificationsTrackerTest, LargeIconsAreScaledDown) { |
| ASSERT_EQ(kPlatformNotificationMaxIconSizePx, |
| GetResources(0u)->notification_icon.height()); |
| + ASSERT_FALSE(GetResources(0u)->small_icon.drawsNothing()); |
| + ASSERT_EQ(kPlatformNotificationMaxSmallIconSizePx, |
| + GetResources(0u)->small_icon.width()); |
| + ASSERT_EQ(kPlatformNotificationMaxSmallIconSizePx, |
| + GetResources(0u)->small_icon.height()); |
| + |
| ASSERT_EQ(1u, GetResources(0u)->action_icons.size()); |
| ASSERT_FALSE(GetResources(0u)->action_icons[0].drawsNothing()); |
| ASSERT_EQ(kPlatformNotificationMaxActionIconSizePx, |