Satoru Takabayashi | 5ebb4ce | 2018-08-16 10:28:13 +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_TEST_UTIL_H_ |
| 6 | #define CRASH_REPORTER_TEST_UTIL_H_ |
| 7 | |
Satoru Takabayashi | 8ce6db8 | 2018-08-17 15:18:41 +0900 | [diff] [blame^] | 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
Satoru Takabayashi | 5ebb4ce | 2018-08-16 10:28:13 +0900 | [diff] [blame] | 11 | #include <base/files/file_path.h> |
| 12 | #include <base/strings/string_piece.h> |
| 13 | |
Satoru Takabayashi | 8ce6db8 | 2018-08-17 15:18:41 +0900 | [diff] [blame^] | 14 | #include <session_manager/dbus-proxy-mocks.h> |
| 15 | |
Satoru Takabayashi | 5ebb4ce | 2018-08-16 10:28:13 +0900 | [diff] [blame] | 16 | namespace test_util { |
| 17 | |
| 18 | // Creates a file at |file_path| with |content|, with parent directories. |
| 19 | // Returns true on success. If you want the test function to stop when the file |
| 20 | // creation failed, wrap this function with ASSERT_TRUE(). |
| 21 | bool CreateFile(const base::FilePath& file_path, base::StringPiece content); |
| 22 | |
Satoru Takabayashi | 8ce6db8 | 2018-08-17 15:18:41 +0900 | [diff] [blame^] | 23 | // Configures |mock| so that RetrieveActiveSessions() returns |sessions|. |
| 24 | void SetActiveSessions(org::chromium::SessionManagerInterfaceProxyMock* mock, |
| 25 | const std::map<std::string, std::string>& sessions); |
| 26 | |
Satoru Takabayashi | 5ebb4ce | 2018-08-16 10:28:13 +0900 | [diff] [blame] | 27 | } // namespace test_util |
| 28 | |
| 29 | #endif // CRASH_REPORTER_TEST_UTIL_H_ |