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

Side by Side Diff: snapshot/test/test_system_snapshot.cc

Issue 694063003: Add MinidumpSystemInfoWriter::InitializeFromSnapshot() and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years, 1 month 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 | « snapshot/test/test_system_snapshot.h ('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
(Empty)
1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include "snapshot/test/test_system_snapshot.h"
16
17 namespace crashpad {
18 namespace test {
19
20 TestSystemSnapshot::TestSystemSnapshot()
21 : cpu_architecture_(kCPUArchitectureUnknown),
22 cpu_revision_(0),
23 cpu_count_(0),
24 cpu_vendor_(),
25 cpu_frequency_current_hz_(0),
26 cpu_frequency_max_hz_(0),
27 cpu_x86_signature_(0),
28 cpu_x86_features_(0),
29 cpu_x86_extended_features_(0),
30 cpu_x86_leaf_7_features_(0),
31 cpu_x86_supports_daz_(false),
32 operating_system_(kOperatingSystemUnknown),
33 os_server_(false),
34 os_version_major_(0),
35 os_version_minor_(0),
36 os_version_bugfix_(0),
37 os_version_build_(),
38 os_version_full_(),
39 nx_enabled_(false),
40 machine_description_(),
41 time_zone_dst_status_(kDoesNotObserveDaylightSavingTime),
42 time_zone_standard_offset_seconds_(0),
43 time_zone_daylight_offset_seconds_(0),
44 time_zone_standard_name_(),
45 time_zone_daylight_name_() {
46 }
47
48 TestSystemSnapshot::~TestSystemSnapshot() {
49 }
50
51 CPUArchitecture TestSystemSnapshot::GetCPUArchitecture() const {
52 return cpu_architecture_;
53 }
54
55 uint32_t TestSystemSnapshot::CPURevision() const {
56 return cpu_revision_;
57 }
58
59 uint8_t TestSystemSnapshot::CPUCount() const {
60 return cpu_count_;
61 }
62
63 std::string TestSystemSnapshot::CPUVendor() const {
64 return cpu_vendor_;
65 }
66
67 void TestSystemSnapshot::CPUFrequency(uint64_t* current_hz,
68 uint64_t* max_hz) const {
69 *current_hz = cpu_frequency_current_hz_;
70 *max_hz = cpu_frequency_max_hz_;
71 }
72
73 uint32_t TestSystemSnapshot::CPUX86Signature() const {
74 return cpu_x86_signature_;
75 }
76
77 uint64_t TestSystemSnapshot::CPUX86Features() const {
78 return cpu_x86_features_;
79 }
80
81 uint64_t TestSystemSnapshot::CPUX86ExtendedFeatures() const {
82 return cpu_x86_extended_features_;
83 }
84
85 uint32_t TestSystemSnapshot::CPUX86Leaf7Features() const {
86 return cpu_x86_leaf_7_features_;
87 }
88
89 bool TestSystemSnapshot::CPUX86SupportsDAZ() const {
90 return cpu_x86_supports_daz_;
91 }
92
93 SystemSnapshot::OperatingSystem TestSystemSnapshot::GetOperatingSystem() const {
94 return operating_system_;
95 }
96
97 bool TestSystemSnapshot::OSServer() const {
98 return os_server_;
99 }
100
101 void TestSystemSnapshot::OSVersion(
102 int* major, int* minor, int* bugfix, std::string* build) const {
103 *major = os_version_major_;
104 *minor = os_version_minor_;
105 *bugfix = os_version_bugfix_;
106 *build = os_version_build_;
107 }
108
109 std::string TestSystemSnapshot::OSVersionFull() const {
110 return os_version_full_;
111 }
112
113 bool TestSystemSnapshot::NXEnabled() const {
114 return nx_enabled_;
115 }
116
117 std::string TestSystemSnapshot::MachineDescription() const {
118 return machine_description_;
119 }
120
121 void TestSystemSnapshot::TimeZone(DaylightSavingTimeStatus* dst_status,
122 int* standard_offset_seconds,
123 int* daylight_offset_seconds,
124 std::string* standard_name,
125 std::string* daylight_name) const {
126 *dst_status = time_zone_dst_status_;
127 *standard_offset_seconds = time_zone_standard_offset_seconds_;
128 *daylight_offset_seconds = time_zone_daylight_offset_seconds_;
129 *standard_name = time_zone_standard_name_;
130 *daylight_name = time_zone_daylight_name_;
131 }
132
133 } // namespace test
134 } // namespace crashpad
OLDNEW
« no previous file with comments | « snapshot/test/test_system_snapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698