blob: 9d4399ce21f71c54e122794cbcf2914f1080c9f2 [file] [log] [blame]
Satoru Takabayashie7f6d2a2018-08-08 17:06:29 +09001// 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 Takabayashib2ca40d2018-08-09 14:02:04 +09008#include <string>
9#include <vector>
10
11#include <base/files/file_path.h>
12
Satoru Takabayashie7f6d2a2018-08-08 17:06:29 +090013namespace util {
14
15// Returns true if integration tests are currently running.
16bool IsCrashTestInProgress();
17
18// Returns true if running on a developer image.
19bool IsDeveloperImage();
20
Satoru Takabayashib2ca40d2018-08-09 14:02:04 +090021// 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.
25bool 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.
32bool GetCachedKeyValueDefault(const base::FilePath& base_name,
33 const std::string& key,
34 std::string* value);
35
Satoru Takabayashie7f6d2a2018-08-08 17:06:29 +090036} // namespace util
37
38#endif // CRASH_REPORTER_UTIL_H_