Index: third_party/crazy_linker/crazy_linker/src/crazy_linker_system_mock.h |
diff --git a/third_party/crazy_linker/crazy_linker/src/crazy_linker_system_mock.h b/third_party/crazy_linker/crazy_linker/src/crazy_linker_system_mock.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..19c9035805f5a18ddc77f4ca797c4d6d56ae9f37 |
--- /dev/null |
+++ b/third_party/crazy_linker/crazy_linker/src/crazy_linker_system_mock.h |
@@ -0,0 +1,35 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CRAZY_LINKER_SYSTEM_MOCK_H |
+#define CRAZY_LINKER_SYSTEM_MOCK_H |
+ |
+#include <stdint.h> |
+ |
+namespace crazy { |
+ |
+class SystemMock { |
+public: |
+ // Create a new mock system instance and make ScopedFileDescriptor use it. |
+ // There can be only one mock system active at a given time. |
+ SystemMock(); |
+ |
+ // Destroy a mock system instance. |
+ ~SystemMock(); |
+ |
+ // Add a regular file to the mock file system. |path| is the entry's |
+ // path, and |data| and |data_size| are the data there. The data must |
+ // stay valid until the mock file system is destroyed. |
+ void AddRegularFile(const char* path, |
+ const char* data, |
+ size_t data_size); |
+ |
+ void AddEnvVariable(const char* var_name, const char* var_value); |
+ |
+ void SetCurrentDir(const char* path); |
+}; |
+ |
+} // namespace crazy |
+ |
+#endif // CRAZY_LINKER_SYSTEM_MOCK_H |