1 : // Copyright 2015 Google Inc. 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 "syzygy/kasko/testing/mock_service.h"
16 :
17 : namespace kasko {
18 : namespace testing {
19 :
20 : MockService::MockService(std::vector<CallRecord>* call_log)
21 E : : call_log_(call_log) {}
22 :
23 E : MockService::~MockService() {}
24 :
25 : void MockService::SendDiagnosticReport(
26 : base::ProcessId client_process_id,
27 : uint64_t exception_info_address,
28 : base::PlatformThreadId thread_id,
29 : MinidumpType minidump_type,
30 : const char* protobuf,
31 : size_t protobuf_length,
32 E : const std::map<base::string16, base::string16>& crash_keys) {
33 : CallRecord record = {client_process_id,
34 : minidump_type,
35 : std::string(protobuf, protobuf_length),
36 E : crash_keys};
37 E : call_log_->push_back(record);
38 E : }
39 :
40 : } // namespace testing
41 : } // namespace kasko
|