Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: ui/arc/notification/arc_notification_manager_unittest.cc

Issue 2496423004: arc: enable use_new_wrapper_types for notifications.mojom (Closed)
Patch Set: address comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/arc/notification/arc_notification_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_notification_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698