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

Unified Diff: snapshot/test/test_process_snapshot.cc

Issue 701783004: Add MinidumpMiscInfoWriter::InitializeFromSnapshot() and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_init_from_snapshot_system_info
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/test/test_process_snapshot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/test/test_process_snapshot.cc
diff --git a/snapshot/test/test_process_snapshot.cc b/snapshot/test/test_process_snapshot.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4b343261f76647328b052fd7d18ff316d03d16cb
--- /dev/null
+++ b/snapshot/test/test_process_snapshot.cc
@@ -0,0 +1,87 @@
+// Copyright 2014 The Crashpad Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "snapshot/exception_snapshot.h"
+#include "snapshot/module_snapshot.h"
+#include "snapshot/system_snapshot.h"
+#include "snapshot/test/test_process_snapshot.h"
+#include "snapshot/thread_snapshot.h"
+
+namespace crashpad {
+namespace test {
+
+TestProcessSnapshot::TestProcessSnapshot()
+ : process_id_(0),
+ parent_process_id_(0),
+ snapshot_time_(),
+ process_start_time_(),
+ process_cpu_user_time_(),
+ process_cpu_system_time_(),
+ system_(),
+ threads_(),
+ modules_(),
+ exception_() {
+}
+
+TestProcessSnapshot::~TestProcessSnapshot() {
+}
+
+pid_t TestProcessSnapshot::ProcessID() const {
+ return process_id_;
+}
+
+pid_t TestProcessSnapshot::ParentProcessID() const {
+ return parent_process_id_;
+}
+
+void TestProcessSnapshot::SnapshotTime(timeval* snapshot_time) const {
+ *snapshot_time = snapshot_time_;
+}
+
+void TestProcessSnapshot::ProcessStartTime(timeval* start_time) const {
+ *start_time = process_start_time_;
+}
+
+void TestProcessSnapshot::ProcessCPUTimes(timeval* user_time,
+ timeval* system_time) const {
+ *user_time = process_cpu_user_time_;
+ *system_time = process_cpu_system_time_;
+}
+
+const SystemSnapshot* TestProcessSnapshot::System() const {
+ return system_.get();
+}
+
+std::vector<const ThreadSnapshot*> TestProcessSnapshot::Threads() const {
+ std::vector<const ThreadSnapshot*> threads;
+ for (const ThreadSnapshot* thread : threads_) {
+ threads.push_back(thread);
+ }
+ return threads;
+}
+
+std::vector<const ModuleSnapshot*> TestProcessSnapshot::Modules() const {
+ std::vector<const ModuleSnapshot*> modules;
+ for (const ModuleSnapshot* module : modules_) {
+ modules.push_back(module);
+ }
+ return modules;
+}
+
+const ExceptionSnapshot* TestProcessSnapshot::Exception() const {
+ return exception_.get();
+}
+
+} // namespace test
+} // namespace crashpad
« no previous file with comments | « snapshot/test/test_process_snapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698