| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <memory> | 6 #include <memory> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return CreateNotificationWithKey(kDummyNotificationKey); | 93 return CreateNotificationWithKey(kDummyNotificationKey); |
| 94 } | 94 } |
| 95 | 95 |
| 96 std::string CreateNotificationWithKey(const std::string& key) { | 96 std::string CreateNotificationWithKey(const std::string& key) { |
| 97 auto data = mojom::ArcNotificationData::New(); | 97 auto data = mojom::ArcNotificationData::New(); |
| 98 data->key = key; | 98 data->key = key; |
| 99 data->title = "TITLE"; | 99 data->title = "TITLE"; |
| 100 data->message = "MESSAGE"; | 100 data->message = "MESSAGE"; |
| 101 | 101 |
| 102 std::vector<unsigned char> icon_data; | 102 std::vector<unsigned char> icon_data; |
| 103 data->icon_data.Swap(&icon_data); | 103 data->icon_data = icon_data; |
| 104 | 104 |
| 105 arc_notification_manager()->OnNotificationPosted(std::move(data)); | 105 arc_notification_manager()->OnNotificationPosted(std::move(data)); |
| 106 | 106 |
| 107 return key; | 107 return key; |
| 108 } | 108 } |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 base::MessageLoop loop_; | 111 base::MessageLoop loop_; |
| 112 std::unique_ptr<FakeArcBridgeService> service_; | 112 std::unique_ptr<FakeArcBridgeService> service_; |
| 113 std::unique_ptr<FakeNotificationsInstance> arc_notifications_instance_; | 113 std::unique_ptr<FakeNotificationsInstance> arc_notifications_instance_; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 CreateNotificationWithKey("notification2"); | 178 CreateNotificationWithKey("notification2"); |
| 179 CreateNotificationWithKey("notification3"); | 179 CreateNotificationWithKey("notification3"); |
| 180 EXPECT_EQ(3u, message_center()->GetVisibleNotifications().size()); | 180 EXPECT_EQ(3u, message_center()->GetVisibleNotifications().size()); |
| 181 | 181 |
| 182 arc_notification_manager()->OnInstanceClosed(); | 182 arc_notification_manager()->OnInstanceClosed(); |
| 183 | 183 |
| 184 EXPECT_EQ(0u, message_center()->GetVisibleNotifications().size()); | 184 EXPECT_EQ(0u, message_center()->GetVisibleNotifications().size()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace arc | 187 } // namespace arc |
| OLD | NEW |