OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 681 |
682 notifier.ProcessSyncChanges(FROM_HERE, changes); | 682 notifier.ProcessSyncChanges(FROM_HERE, changes); |
683 | 683 |
684 // Since we added to |initialized_sending_services_| before receiving the | 684 // Since we added to |initialized_sending_services_| before receiving the |
685 // synced notification, we should not have enabled this service while | 685 // synced notification, we should not have enabled this service while |
686 // processing the sync change. | 686 // processing the sync change. |
687 EXPECT_EQ(0U, notifier.enabled_sending_services_.size()); | 687 EXPECT_EQ(0U, notifier.enabled_sending_services_.size()); |
688 EXPECT_EQ(0U, notification_manager()->added_notifications()); | 688 EXPECT_EQ(0U, notification_manager()->added_notifications()); |
689 } | 689 } |
690 | 690 |
691 TEST_F(ChromeNotifierServiceTest, SetAddedAppIdsTest) { | 691 #if defined(TOOLKIT_GTK) |
| 692 // TODO(petewil): crbug.com/358031 |
| 693 #define MAYBE_SetAddedAppIdsTest DISABLED_SetAddedAppIdsTest |
| 694 #else |
| 695 #define MAYBE_SetAddedAppIdsTest SetAddedAppIdsTest |
| 696 #endif |
| 697 TEST_F(ChromeNotifierServiceTest, MAYBE_SetAddedAppIdsTest) { |
692 ChromeNotifierService notifier(profile_.get(), notification_manager()); | 698 ChromeNotifierService notifier(profile_.get(), notification_manager()); |
693 notifier.set_avoid_bitmap_fetching_for_test(true); | 699 notifier.set_avoid_bitmap_fetching_for_test(true); |
694 | 700 |
695 // Add some notifications to our notification list. | 701 // Add some notifications to our notification list. |
696 scoped_ptr<SyncedNotification> n1(CreateNotification( | 702 scoped_ptr<SyncedNotification> n1(CreateNotification( |
697 kTitle1, kText1, kIconUrl1, kImageUrl1, kAppId1, kKey1, kUnread)); | 703 kTitle1, kText1, kIconUrl1, kImageUrl1, kAppId1, kKey1, kUnread)); |
698 n1->SetNotifierServiceForTest(¬ifier); | 704 n1->SetNotifierServiceForTest(¬ifier); |
699 notifier.AddForTest(n1.Pass()); | 705 notifier.AddForTest(n1.Pass()); |
700 | 706 |
701 EXPECT_EQ(static_cast<size_t>(0), | 707 EXPECT_EQ(static_cast<size_t>(0), |
(...skipping 25 matching lines...) Expand all Loading... |
727 notifier.OnRemovedAppIds(removed_app_ids); | 733 notifier.OnRemovedAppIds(removed_app_ids); |
728 | 734 |
729 // Verify the notification was "removed" in the notification manager. | 735 // Verify the notification was "removed" in the notification manager. |
730 EXPECT_EQ(std::string(kKey1), notification_manager()->dismissed_id()); | 736 EXPECT_EQ(std::string(kKey1), notification_manager()->dismissed_id()); |
731 } | 737 } |
732 | 738 |
733 // TODO(petewil): Add a test that we do *not* get a welcome dialog unless we | 739 // TODO(petewil): Add a test that we do *not* get a welcome dialog unless we |
734 // have a valid app info for the notification. | 740 // have a valid app info for the notification. |
735 | 741 |
736 } // namespace notifier | 742 } // namespace notifier |
OLD | NEW |