Lines Matching refs:list

36 // Store and retrieve empty list.
38 ListValue list;
41 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
42 EXPECT_EQ(0U, list.GetSize());
46 MetricsService::RecallUnsentLogsHelper(list, &local_list));
52 ListValue list;
58 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
60 // |list| will now contain the following:
62 EXPECT_EQ(3U, list.GetSize());
65 ListValue::const_iterator it = list.begin();
82 EXPECT_TRUE(it == list.end()); // Reached end of list.
86 MetricsService::RecallUnsentLogsHelper(list, &local_list));
92 ListValue list;
108 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
109 EXPECT_EQ(kMaxLocalListSize + 2, list.GetSize());
112 EXPECT_TRUE((*(list.begin() + 1))->GetAsString(&actual_first));
116 EXPECT_TRUE((*(list.end() - 2))->GetAsString(&actual_last));
121 MetricsService::RecallUnsentLogsHelper(list, &local_list));
127 ListValue list;
132 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
133 EXPECT_EQ(3U, list.GetSize());
136 list.Remove(list.GetSize() - 1, NULL);
137 EXPECT_EQ(2U, list.GetSize());
141 MetricsService::RecallUnsentLogsHelper(list, &local_list));
144 // Remove size from the stored list.
146 ListValue list;
152 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
153 EXPECT_EQ(4U, list.GetSize());
155 list.Remove(0, NULL); // Delete size (1st element).
156 EXPECT_EQ(3U, list.GetSize());
160 MetricsService::RecallUnsentLogsHelper(list, &local_list));
163 // Corrupt size of stored list.
165 ListValue list;
170 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
171 EXPECT_EQ(3U, list.GetSize());
173 // Change list size from 1 to 2.
174 EXPECT_TRUE(list.Set(0, Value::CreateIntegerValue(2)));
175 EXPECT_EQ(3U, list.GetSize());
179 MetricsService::RecallUnsentLogsHelper(list, &local_list));
182 // Corrupt checksum of stored list.
184 ListValue list;
190 MetricsService::StoreUnsentLogsHelper(local_list, kMaxLocalListSize, &list);
191 EXPECT_EQ(3U, list.GetSize());
195 EXPECT_TRUE((*(list.end() - 1))->GetAsString(&checksum));
197 EXPECT_TRUE(list.Set(2, Value::CreateStringValue(checksum)));
198 EXPECT_EQ(3U, list.GetSize());
202 MetricsService::RecallUnsentLogsHelper(list, &local_list));