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

Side by Side Diff: components/ukm/ukm_service_unittest.cc

Issue 2689323010: Split a MetricsLogStore object out of MetricsLogManager. (Closed)
Patch Set: Rebase Created 3 years, 10 months 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 | « components/ukm/ukm_service.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/ukm/ukm_service.h" 5 #include "components/ukm/ukm_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 Report GetPersistedReport() { 43 Report GetPersistedReport() {
44 EXPECT_GE(GetPersistedLogCount(), 1); 44 EXPECT_GE(GetPersistedLogCount(), 1);
45 metrics::PersistedLogs result_persisted_logs( 45 metrics::PersistedLogs result_persisted_logs(
46 base::MakeUnique<ukm::PersistedLogsMetricsImpl>(), &prefs_, 46 base::MakeUnique<ukm::PersistedLogsMetricsImpl>(), &prefs_,
47 prefs::kUkmPersistedLogs, 47 prefs::kUkmPersistedLogs,
48 3, // log count limit 48 3, // log count limit
49 1000, // byte limit 49 1000, // byte limit
50 0); 50 0);
51 51
52 result_persisted_logs.DeserializeLogs(); 52 result_persisted_logs.LoadPersistedUnsentLogs();
53 result_persisted_logs.StageLog(); 53 result_persisted_logs.StageNextLog();
54 54
55 std::string uncompressed_log_data; 55 std::string uncompressed_log_data;
56 EXPECT_TRUE(compression::GzipUncompress(result_persisted_logs.staged_log(), 56 EXPECT_TRUE(compression::GzipUncompress(result_persisted_logs.staged_log(),
57 &uncompressed_log_data)); 57 &uncompressed_log_data));
58 58
59 Report report; 59 Report report;
60 EXPECT_TRUE(report.ParseFromString(uncompressed_log_data)); 60 EXPECT_TRUE(report.ParseFromString(uncompressed_log_data));
61 return report; 61 return report;
62 } 62 }
63 63
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Includes a Source, so will persist. 182 // Includes a Source, so will persist.
183 service.Flush(); 183 service.Flush();
184 EXPECT_EQ(GetPersistedLogCount(), 1); 184 EXPECT_EQ(GetPersistedLogCount(), 1);
185 185
186 // Current log has no Sources. 186 // Current log has no Sources.
187 service.Flush(); 187 service.Flush();
188 EXPECT_EQ(GetPersistedLogCount(), 1); 188 EXPECT_EQ(GetPersistedLogCount(), 1);
189 } 189 }
190 190
191 } // namespace ukm 191 } // namespace ukm
OLDNEW
« no previous file with comments | « components/ukm/ukm_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698