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

Side by Side Diff: components/metrics/metrics_log_unittest.cc

Issue 2358223002: Add log date to the metrics log (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/metrics/metrics_log.h" 5 #include "components/metrics/metrics_log.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 system_profile.brand_code()); 127 system_profile.brand_code());
128 128
129 const SystemProfileProto::Hardware& hardware = 129 const SystemProfileProto::Hardware& hardware =
130 system_profile.hardware(); 130 system_profile.hardware();
131 131
132 EXPECT_TRUE(hardware.has_cpu()); 132 EXPECT_TRUE(hardware.has_cpu());
133 EXPECT_TRUE(hardware.cpu().has_vendor_name()); 133 EXPECT_TRUE(hardware.cpu().has_vendor_name());
134 EXPECT_TRUE(hardware.cpu().has_signature()); 134 EXPECT_TRUE(hardware.cpu().has_signature());
135 EXPECT_TRUE(hardware.cpu().has_num_cores()); 135 EXPECT_TRUE(hardware.cpu().has_num_cores());
136 136
137 EXPECT_GE((base::Time::Now() - base::Time::UnixEpoch()).InSeconds(),
138 system_profile.log_date());
137 // TODO(isherman): Verify other data written into the protobuf as a result 139 // TODO(isherman): Verify other data written into the protobuf as a result
138 // of this call. 140 // of this call.
139 } 141 }
140 142
141 protected: 143 protected:
142 TestingPrefServiceSimple prefs_; 144 TestingPrefServiceSimple prefs_;
143 145
144 private: 146 private:
145 DISALLOW_COPY_AND_ASSIGN(MetricsLogTest); 147 DISALLOW_COPY_AND_ASSIGN(MetricsLogTest);
146 }; 148 };
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 TestMetricsServiceClient client; 465 TestMetricsServiceClient client;
464 client.set_product(kTestProduct); 466 client.set_product(kTestProduct);
465 TestMetricsLog log( 467 TestMetricsLog log(
466 kClientId, kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); 468 kClientId, kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_);
467 // Check that the product is set to |kTestProduct|. 469 // Check that the product is set to |kTestProduct|.
468 EXPECT_TRUE(log.uma_proto().has_product()); 470 EXPECT_TRUE(log.uma_proto().has_product());
469 EXPECT_EQ(kTestProduct, log.uma_proto().product()); 471 EXPECT_EQ(kTestProduct, log.uma_proto().product());
470 } 472 }
471 473
472 } // namespace metrics 474 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698