forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_component_controller.h
36 lines (24 loc) · 1018 Bytes
/
test_component_controller.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
// Copyright 2021 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 BASE_FUCHSIA_TEST_COMPONENT_CONTROLLER_H_
#define BASE_FUCHSIA_TEST_COMPONENT_CONTROLLER_H_
#include <fuchsia/sys/cpp/fidl.h>
#include "base/base_export.h"
namespace base {
// fuchsia.sys.ComponentController that requests the component to teardown
// gracefully, and waits for it to do so, when destroyed.
class BASE_EXPORT TestComponentController {
public:
TestComponentController();
~TestComponentController();
TestComponentController(TestComponentController&&);
TestComponentController& operator=(TestComponentController&&);
explicit operator bool() const { return ptr_.is_bound(); }
::fuchsia::sys::ComponentControllerPtr& ptr() { return ptr_; }
void KillAndRunUntilDisconnect();
private:
::fuchsia::sys::ComponentControllerPtr ptr_;
};
} // namespace base
#endif // BASE_FUCHSIA_TEST_COMPONENT_CONTROLLER_H_