OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser_watcher/postmortem_report_collector.h" | 5 #include "components/browser_watcher/postmortem_report_collector.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 MOCK_METHOD1( | 71 MOCK_METHOD1( |
72 GetCompletedReports, | 72 GetCompletedReports, |
73 CrashReportDatabase::OperationStatus(std::vector<Report>* reports)); | 73 CrashReportDatabase::OperationStatus(std::vector<Report>* reports)); |
74 MOCK_METHOD2(GetReportForUploading, | 74 MOCK_METHOD2(GetReportForUploading, |
75 CrashReportDatabase::OperationStatus(const UUID& uuid, | 75 CrashReportDatabase::OperationStatus(const UUID& uuid, |
76 const Report** report)); | 76 const Report** report)); |
77 MOCK_METHOD3(RecordUploadAttempt, | 77 MOCK_METHOD3(RecordUploadAttempt, |
78 CrashReportDatabase::OperationStatus(const Report* report, | 78 CrashReportDatabase::OperationStatus(const Report* report, |
79 bool successful, | 79 bool successful, |
80 const std::string& id)); | 80 const std::string& id)); |
81 MOCK_METHOD1(SkipReportUpload, | 81 MOCK_METHOD2(SkipReportUpload, |
82 CrashReportDatabase::OperationStatus(const UUID& uuid)); | 82 CrashReportDatabase::OperationStatus( |
| 83 const UUID& uuid, |
| 84 crashpad::Metrics::CrashSkippedReason reason)); |
83 MOCK_METHOD1(DeleteReport, | 85 MOCK_METHOD1(DeleteReport, |
84 CrashReportDatabase::OperationStatus(const UUID& uuid)); | 86 CrashReportDatabase::OperationStatus(const UUID& uuid)); |
85 MOCK_METHOD1(RequestUpload, | 87 MOCK_METHOD1(RequestUpload, |
86 CrashReportDatabase::OperationStatus(const UUID& uuid)); | 88 CrashReportDatabase::OperationStatus(const UUID& uuid)); |
87 }; | 89 }; |
88 | 90 |
89 // Used for testing CollectAndSubmitForUpload. | 91 // Used for testing CollectAndSubmitForUpload. |
90 class MockPostmortemReportCollector : public PostmortemReportCollector { | 92 class MockPostmortemReportCollector : public PostmortemReportCollector { |
91 public: | 93 public: |
92 MockPostmortemReportCollector() {} | 94 MockPostmortemReportCollector() {} |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // Build the expected report. | 410 // Build the expected report. |
409 StabilityReport expected_report; | 411 StabilityReport expected_report; |
410 ProcessState* process_state = expected_report.add_process_states(); | 412 ProcessState* process_state = expected_report.add_process_states(); |
411 ThreadState* thread_state = process_state->add_threads(); | 413 ThreadState* thread_state = process_state->add_threads(); |
412 thread_state->set_thread_name(base::PlatformThread::GetName()); | 414 thread_state->set_thread_name(base::PlatformThread::GetName()); |
413 | 415 |
414 ASSERT_EQ(expected_report.SerializeAsString(), report->SerializeAsString()); | 416 ASSERT_EQ(expected_report.SerializeAsString(), report->SerializeAsString()); |
415 } | 417 } |
416 | 418 |
417 } // namespace browser_watcher | 419 } // namespace browser_watcher |
OLD | NEW |