Thanks to visit codestin.com
Credit goes to chromium.googlesource.com

blob: cb6a4a765866a4deec825f1769b06817f545eb7e [file] [log] [blame]
Aman Verma327f9b42022-11-08 12:44:401// Copyright 2022 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_PROCESS_CURRENT_PROCESS_TEST_H_
6#define BASE_PROCESS_CURRENT_PROCESS_TEST_H_
7
8#include <string>
Peter Kasting134ef9af2024-12-28 02:30:099
Aman Verma327f9b42022-11-08 12:44:4010#include "base/process/current_process.h"
11
12namespace base::test {
13
14// This class is used for getting current process type and name for testing
15// without any access controls.
16class CurrentProcessForTest {
17 public:
18 static CurrentProcessType GetType() {
19 return CurrentProcess::GetInstance().GetType(CurrentProcess::TypeKey());
20 }
21
22 static std::string GetName() {
23 return CurrentProcess::GetInstance().GetName(CurrentProcess::NameKey());
24 }
25};
26
27} // namespace base::test
28
29#endif // BASE_PROCESS_CURRENT_PROCESS_TEST_H_