Mock a /postinstall dir at test time
Bug: 172696594
Test: treehugger
Change-Id: Ib6264569d090dc61fc9ded5f833e3841ec16a8dd
diff --git a/payload_consumer/postinstall_runner_action.h b/payload_consumer/postinstall_runner_action.h
index e404107..178d72a 100644
--- a/payload_consumer/postinstall_runner_action.h
+++ b/payload_consumer/postinstall_runner_action.h
@@ -19,6 +19,7 @@
#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include <base/files/file_descriptor_watcher_posix.h>
@@ -40,8 +41,7 @@
class PostinstallRunnerAction : public InstallPlanAction {
public:
PostinstallRunnerAction(BootControlInterface* boot_control,
- HardwareInterface* hardware)
- : boot_control_(boot_control), hardware_(hardware) {}
+ HardwareInterface* hardware);
// InstallPlanAction overrides.
void PerformAction() override;
@@ -68,6 +68,9 @@
friend class PostinstallRunnerActionTest;
FRIEND_TEST(PostinstallRunnerActionTest, ProcessProgressLineTest);
+ // exposed for testing purposes only
+ void SetMountDir(std::string dir) { fs_mount_dir_ = std::move(dir); }
+
void PerformPartitionPostinstall();
// Called whenever the |progress_fd_| has data available to read.