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

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

Issue 2671433002: Don't set cpu architecture field on iOS in UMA logs. (Closed)
Patch Set: Fix test. 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/metrics/metrics_log.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 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 SystemProfileProto* system_profile = expected.mutable_system_profile(); 188 SystemProfileProto* system_profile = expected.mutable_system_profile();
189 system_profile->set_app_version("bogus version"); 189 system_profile->set_app_version("bogus version");
190 system_profile->set_channel(client.GetChannel()); 190 system_profile->set_channel(client.GetChannel());
191 system_profile->set_application_locale(client.GetApplicationLocale()); 191 system_profile->set_application_locale(client.GetApplicationLocale());
192 192
193 #if defined(SYZYASAN) 193 #if defined(SYZYASAN)
194 system_profile->set_is_asan_build(true); 194 system_profile->set_is_asan_build(true);
195 #endif 195 #endif
196 metrics::SystemProfileProto::Hardware* hardware = 196 metrics::SystemProfileProto::Hardware* hardware =
197 system_profile->mutable_hardware(); 197 system_profile->mutable_hardware();
198 #if !defined(OS_IOS)
198 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); 199 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture());
200 #endif
199 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); 201 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB());
200 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); 202 hardware->set_hardware_class(base::SysInfo::HardwareModelName());
201 #if defined(OS_WIN) 203 #if defined(OS_WIN)
202 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); 204 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE()));
203 #endif 205 #endif
204 206
205 system_profile->mutable_os()->set_name(base::SysInfo::OperatingSystemName()); 207 system_profile->mutable_os()->set_name(base::SysInfo::OperatingSystemName());
206 system_profile->mutable_os()->set_version( 208 system_profile->mutable_os()->set_version(
207 base::SysInfo::OperatingSystemVersion()); 209 base::SysInfo::OperatingSystemVersion());
208 #if defined(OS_ANDROID) 210 #if defined(OS_ANDROID)
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 TestMetricsServiceClient client; 499 TestMetricsServiceClient client;
498 client.set_product(kTestProduct); 500 client.set_product(kTestProduct);
499 TestMetricsLog log( 501 TestMetricsLog log(
500 kClientId, kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); 502 kClientId, kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_);
501 // Check that the product is set to |kTestProduct|. 503 // Check that the product is set to |kTestProduct|.
502 EXPECT_TRUE(log.uma_proto().has_product()); 504 EXPECT_TRUE(log.uma_proto().has_product());
503 EXPECT_EQ(kTestProduct, log.uma_proto().product()); 505 EXPECT_EQ(kTestProduct, log.uma_proto().product());
504 } 506 }
505 507
506 } // namespace metrics 508 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/metrics_log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698