Chromium Code Reviews| Index: chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc |
| diff --git a/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc b/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc |
| index aa7f5678e7fb73fc78d6d39186a81b2b29456a3c..cbfde070899c4cdd40051dc853ef750a01b34d17 100644 |
| --- a/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc |
| +++ b/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc |
| @@ -61,11 +61,21 @@ class NotificationBuilder { |
| return *this; |
| } |
| + NotificationBuilder& SetMessage(const base::string16& message) { |
| + notification_.set_message(message); |
| + return *this; |
| + } |
| + |
| NotificationBuilder& SetNeverTimeout(bool never_timeout) { |
| notification_.set_never_timeout(never_timeout); |
| return *this; |
| } |
| + NotificationBuilder& SetOriginUrl(const GURL& origin_url) { |
| + notification_.set_origin_url(origin_url); |
| + return *this; |
| + } |
| + |
| NotificationBuilder& SetProgress(int progress) { |
| notification_.set_progress(progress); |
| return *this; |
| @@ -389,3 +399,21 @@ TEST_F(NotificationPlatformBridgeLinuxTest, NotificationImages) { |
| .SetImage(original_image) |
| .GetResult()); |
| } |
| + |
| +TEST_F(NotificationPlatformBridgeLinuxTest, NotificationAttribution) { |
| + EXPECT_CALL(*mock_notification_proxy_.get(), |
| + MockCallMethodAndBlock(Calls("Notify"), _)) |
| + .WillOnce(OnNotify( |
| + [](const NotificationRequest& request) { |
| + EXPECT_EQ("Body text\ngoogle.com", request.body); |
| + }, |
| + 1)); |
| + |
| + CreateNotificationBridgeLinux(); |
| + notification_bridge_linux_->Display( |
| + NotificationCommon::PERSISTENT, "", "", false, |
| + NotificationBuilder("") |
| + .SetMessage(base::UTF8ToUTF16("Body text")) |
|
Lei Zhang
2017/05/15 22:19:59
ACIIToUTF16() when you know it's ASCII.
Tom (Use chromium acct)
2017/05/16 04:43:34
Done.
|
| + .SetOriginUrl(GURL("https://google.com/")) |
|
Lei Zhang
2017/05/15 22:19:59
I'm not sure what guarantees the notification subs
Tom (Use chromium acct)
2017/05/16 04:43:34
Done. (maybe)
|
| + .GetResult()); |
| +} |