| OLD | NEW |
| 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 Loading... |
| 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) | |
| 199 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 198 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
| 200 #endif | |
| 201 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 199 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
| 202 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); | 200 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); |
| 203 #if defined(OS_WIN) | 201 #if defined(OS_WIN) |
| 204 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); | 202 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); |
| 205 #endif | 203 #endif |
| 206 | 204 |
| 207 system_profile->mutable_os()->set_name(base::SysInfo::OperatingSystemName()); | 205 system_profile->mutable_os()->set_name(base::SysInfo::OperatingSystemName()); |
| 208 system_profile->mutable_os()->set_version( | 206 system_profile->mutable_os()->set_version( |
| 209 base::SysInfo::OperatingSystemVersion()); | 207 base::SysInfo::OperatingSystemVersion()); |
| 210 #if defined(OS_ANDROID) | 208 #if defined(OS_ANDROID) |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 TestMetricsServiceClient client; | 497 TestMetricsServiceClient client; |
| 500 client.set_product(kTestProduct); | 498 client.set_product(kTestProduct); |
| 501 TestMetricsLog log( | 499 TestMetricsLog log( |
| 502 kClientId, kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); | 500 kClientId, kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); |
| 503 // Check that the product is set to |kTestProduct|. | 501 // Check that the product is set to |kTestProduct|. |
| 504 EXPECT_TRUE(log.uma_proto().has_product()); | 502 EXPECT_TRUE(log.uma_proto().has_product()); |
| 505 EXPECT_EQ(kTestProduct, log.uma_proto().product()); | 503 EXPECT_EQ(kTestProduct, log.uma_proto().product()); |
| 506 } | 504 } |
| 507 | 505 |
| 508 } // namespace metrics | 506 } // namespace metrics |
| OLD | NEW |