forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_util.h
52 lines (39 loc) · 1.44 KB
/
test_util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SERVICES_TRACING_TEST_UTIL_H_
#define SERVICES_TRACING_TEST_UTIL_H_
#include <string>
#include <vector>
#include "base/trace_event/trace_log.h"
#include "base/values.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/tracing/public/mojom/tracing.mojom.h"
namespace base {
class TimeTicks;
} // namespace base
namespace tracing {
class MockAgent : public mojom::Agent {
public:
MockAgent();
~MockAgent() override;
mojo::PendingRemote<mojom::Agent> CreateAgentRemote();
std::vector<std::string> call_stat() const { return call_stat_; }
// Set these variables to configure the agent.
std::vector<std::string> data_;
base::DictionaryValue metadata_;
std::string categories_;
base::trace_event::TraceLogStatus trace_log_status_;
private:
// mojom::Agent
void StartTracing(const std::string& config,
base::TimeTicks coordinator_time,
StartTracingCallback cb) override;
void StopAndFlush(mojo::PendingRemote<mojom::Recorder> recorder) override;
void RequestBufferStatus(RequestBufferStatusCallback cb) override;
mojo::Receiver<mojom::Agent> receiver_{this};
std::vector<std::string> call_stat_;
};
} // namespace tracing
#endif // SERVICES_TRACING_TEST_UTIL_H_