OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 EXPECT_EQ("ok", script_result); | 344 EXPECT_EQ("ok", script_result); |
345 | 345 |
346 ASSERT_EQ(2u, ui_manager()->GetNotificationCount()); | 346 ASSERT_EQ(2u, ui_manager()->GetNotificationCount()); |
347 | 347 |
348 // We don't use or check the notification's direction and language. | 348 // We don't use or check the notification's direction and language. |
349 const Notification& all_options_notification = | 349 const Notification& all_options_notification = |
350 ui_manager()->GetNotificationAt(1); | 350 ui_manager()->GetNotificationAt(1); |
351 EXPECT_EQ("Title", base::UTF16ToUTF8(all_options_notification.title())); | 351 EXPECT_EQ("Title", base::UTF16ToUTF8(all_options_notification.title())); |
352 EXPECT_EQ("Contents", base::UTF16ToUTF8(all_options_notification.message())); | 352 EXPECT_EQ("Contents", base::UTF16ToUTF8(all_options_notification.message())); |
353 EXPECT_EQ("replace-id", all_options_notification.tag()); | 353 EXPECT_EQ("replace-id", all_options_notification.tag()); |
| 354 #if !defined(OS_MACOSX) |
354 EXPECT_FALSE(all_options_notification.image().IsEmpty()); | 355 EXPECT_FALSE(all_options_notification.image().IsEmpty()); |
355 EXPECT_EQ(kIconWidth, all_options_notification.image().Width()); | 356 EXPECT_EQ(kIconWidth, all_options_notification.image().Width()); |
356 EXPECT_EQ(kIconHeight, all_options_notification.image().Height()); | 357 EXPECT_EQ(kIconHeight, all_options_notification.image().Height()); |
| 358 #endif |
357 EXPECT_FALSE(all_options_notification.icon().IsEmpty()); | 359 EXPECT_FALSE(all_options_notification.icon().IsEmpty()); |
358 EXPECT_EQ(kIconWidth, all_options_notification.icon().Width()); | 360 EXPECT_EQ(kIconWidth, all_options_notification.icon().Width()); |
359 EXPECT_EQ(kIconHeight, all_options_notification.icon().Height()); | 361 EXPECT_EQ(kIconHeight, all_options_notification.icon().Height()); |
360 EXPECT_TRUE(all_options_notification.small_image().IsEmpty()); | 362 EXPECT_TRUE(all_options_notification.small_image().IsEmpty()); |
361 EXPECT_TRUE(all_options_notification.renotify()); | 363 EXPECT_TRUE(all_options_notification.renotify()); |
362 EXPECT_TRUE(all_options_notification.silent()); | 364 EXPECT_TRUE(all_options_notification.silent()); |
363 EXPECT_TRUE(all_options_notification.never_timeout()); | 365 EXPECT_TRUE(all_options_notification.never_timeout()); |
364 EXPECT_DOUBLE_EQ(kNotificationTimestamp, | 366 EXPECT_DOUBLE_EQ(kNotificationTimestamp, |
365 all_options_notification.timestamp().ToJsTime()); | 367 all_options_notification.timestamp().ToJsTime()); |
366 EXPECT_EQ(1u, all_options_notification.buttons().size()); | 368 EXPECT_EQ(1u, all_options_notification.buttons().size()); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); | 843 RunScript("DisplayPersistentAllOptionsNotification()", &script_result)); |
842 EXPECT_EQ("ok", script_result); | 844 EXPECT_EQ("ok", script_result); |
843 | 845 |
844 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); | 846 ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
845 const Notification& notification = ui_manager()->GetNotificationAt(0); | 847 const Notification& notification = ui_manager()->GetNotificationAt(0); |
846 | 848 |
847 // Since the kNotificationContentImage kill switch has disabled images, the | 849 // Since the kNotificationContentImage kill switch has disabled images, the |
848 // notification should be shown without an image. | 850 // notification should be shown without an image. |
849 EXPECT_TRUE(notification.image().IsEmpty()); | 851 EXPECT_TRUE(notification.image().IsEmpty()); |
850 } | 852 } |
OLD | NEW |