forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtracing_service_unittest.cc
52 lines (40 loc) · 1.54 KB
/
tracing_service_unittest.cc
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 2018 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.
#include <memory>
#include "base/macros.h"
#include "base/run_loop.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_test.h"
#include "services/tracing/public/mojom/constants.mojom.h"
#include "services/tracing/public/mojom/tracing.mojom.h"
#include "services/tracing/test_util.h"
namespace tracing {
class TracingServiceTest : public service_manager::test::ServiceTest {
public:
TracingServiceTest()
: service_manager::test::ServiceTest("tracing_unittests") {}
~TracingServiceTest() override {}
protected:
void SetUp() override {
service_manager::test::ServiceTest::SetUp();
connector()->StartService(mojom::kServiceName);
}
void SetRunLoopToQuit(base::RunLoop* loop) { loop_ = loop; }
private:
base::RunLoop* loop_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(TracingServiceTest);
};
TEST_F(TracingServiceTest, TracingServiceInstantiate) {
base::RunLoop run_loop;
mojom::AgentRegistryPtr agent_registry;
connector()->BindInterface(mojom::kServiceName,
mojo::MakeRequest(&agent_registry));
MockAgent agent1;
agent_registry->RegisterAgent(
agent1.CreateAgentPtr(), "FOO", mojom::TraceDataType::STRING,
false /*supports_explicit_clock_sync*/, base::kNullProcessId);
run_loop.RunUntilIdle();
}
} // namespace tracing