| Aman Verma | 327f9b4 | 2022-11-08 12:44:40 | [diff] [blame] | 1 | // 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 Kasting | 134ef9af | 2024-12-28 02:30:09 | [diff] [blame] | 9 | |
| Aman Verma | 327f9b4 | 2022-11-08 12:44:40 | [diff] [blame] | 10 | #include "base/process/current_process.h" |
| 11 | |
| 12 | namespace base::test { |
| 13 | |
| 14 | // This class is used for getting current process type and name for testing |
| 15 | // without any access controls. |
| 16 | class 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_ |