Satoru Takabayashi | e7f6d2a | 2018-08-08 17:06:29 +0900 | [diff] [blame] | 1 | // Copyright 2018 The Chromium OS Authors. All rights reserved. |
| 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 CRASH_REPORTER_UTIL_H_ |
| 6 | #define CRASH_REPORTER_UTIL_H_ |
| 7 | |
Satoru Takabayashi | b2ca40d | 2018-08-09 14:02:04 +0900 | [diff] [blame^] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <base/files/file_path.h> |
| 12 | |
Satoru Takabayashi | e7f6d2a | 2018-08-08 17:06:29 +0900 | [diff] [blame] | 13 | namespace util { |
| 14 | |
| 15 | // Returns true if integration tests are currently running. |
| 16 | bool IsCrashTestInProgress(); |
| 17 | |
| 18 | // Returns true if running on a developer image. |
| 19 | bool IsDeveloperImage(); |
| 20 | |
Satoru Takabayashi | b2ca40d | 2018-08-09 14:02:04 +0900 | [diff] [blame^] | 21 | // Tries to find |key| in a key-value file named |base_name| in |directories| in |
| 22 | // the specified order, and writes the value to |value|. This function returns |
| 23 | // as soon as the key is found (i.e. if the key is found in the first directory, |
| 24 | // the remaining directories won't be checked). Returns true on success. |
| 25 | bool GetCachedKeyValue(const base::FilePath& base_name, |
| 26 | const std::string& key, |
| 27 | const std::vector<base::FilePath>& directories, |
| 28 | std::string* value); |
| 29 | |
| 30 | // Similar to GetCachedKeyValue(), but this version checks the predefined |
| 31 | // default directories. |
| 32 | bool GetCachedKeyValueDefault(const base::FilePath& base_name, |
| 33 | const std::string& key, |
| 34 | std::string* value); |
| 35 | |
Satoru Takabayashi | e7f6d2a | 2018-08-08 17:06:29 +0900 | [diff] [blame] | 36 | } // namespace util |
| 37 | |
| 38 | #endif // CRASH_REPORTER_UTIL_H_ |