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

Unified Diff: components/metrics/persistent_system_profile_unittest.cc

Issue 2918533003: Send metrics with embedded system profiles after system startup. (Closed)
Patch Set: fixed tests on mac Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/persistent_system_profile_unittest.cc
diff --git a/components/metrics/persistent_system_profile_unittest.cc b/components/metrics/persistent_system_profile_unittest.cc
index 93f297a81cddb017b7dd96058f56d29017f62bc9..5ca4e898637f28e3a37e043b7a756afecea06dee 100644
--- a/components/metrics/persistent_system_profile_unittest.cc
+++ b/components/metrics/persistent_system_profile_unittest.cc
@@ -91,11 +91,10 @@ TEST_F(PersistentSystemProfileTest, ProfileStorage) {
trial->set_name_id(123);
trial->set_group_id(456);
- std::string serialized_proto;
- ASSERT_TRUE(proto1.SerializeToString(&serialized_proto));
- persistent_profile()->SetSystemProfile(serialized_proto);
+ persistent_profile()->SetSystemProfile(proto1);
Alexei Svitkine (slow) 2017/06/08 23:59:31 Nit: Name the new function that takes the proto Se
bcwhite 2017/06/09 15:09:28 It's setting a "profile", not a "profile proto" so
SystemProfileProto proto2;
+ ASSERT_TRUE(PersistentSystemProfile::HasSystemProfile(*memory_allocator()));
ASSERT_TRUE(
PersistentSystemProfile::GetSystemProfile(*memory_allocator(), &proto2));
ASSERT_EQ(1, proto2.field_trial_size());
@@ -108,8 +107,7 @@ TEST_F(PersistentSystemProfileTest, ProfileStorage) {
trial->set_name_id(78);
trial->set_group_id(90);
- ASSERT_TRUE(proto1.SerializeToString(&serialized_proto));
- persistent_profile()->SetSystemProfile(serialized_proto);
+ persistent_profile()->SetSystemProfile(proto1);
ASSERT_TRUE(
PersistentSystemProfile::GetSystemProfile(*memory_allocator(), &proto2));
« components/metrics/metrics_service.cc ('K') | « components/metrics/persistent_system_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698