blob: f066b5fe13f6bfba24a4b8d936469b125c628d2c [file] [log] [blame]
Satoru Takabayashi5ebb4ce2018-08-16 10:28:13 +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_TEST_UTIL_H_
6#define CRASH_REPORTER_TEST_UTIL_H_
7
Satoru Takabayashi8ce6db82018-08-17 15:18:41 +09008#include <map>
9#include <string>
10
Satoru Takabayashi5ebb4ce2018-08-16 10:28:13 +090011#include <base/files/file_path.h>
12#include <base/strings/string_piece.h>
13
Satoru Takabayashi8ce6db82018-08-17 15:18:41 +090014#include <session_manager/dbus-proxy-mocks.h>
15
Satoru Takabayashi5ebb4ce2018-08-16 10:28:13 +090016namespace 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().
21bool CreateFile(const base::FilePath& file_path, base::StringPiece content);
22
Satoru Takabayashi8ce6db82018-08-17 15:18:41 +090023// Configures |mock| so that RetrieveActiveSessions() returns |sessions|.
24void SetActiveSessions(org::chromium::SessionManagerInterfaceProxyMock* mock,
25 const std::map<std::string, std::string>& sessions);
26
Satoru Takabayashi5ebb4ce2018-08-16 10:28:13 +090027} // namespace test_util
28
29#endif // CRASH_REPORTER_TEST_UTIL_H_