diff --git a/payload_state_unittest.cc b/payload_state_unittest.cc
index 9d73200..24f75e8 100644
--- a/payload_state_unittest.cc
+++ b/payload_state_unittest.cc
@@ -2,13 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "update_engine/payload_state.h"
+
 #include <glib.h>
 
 #include <base/files/file_path.h>
-#include "base/files/file_util.h"
+#include <base/files/file_util.h>
 #include <base/strings/stringprintf.h>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
 
 #include "update_engine/constants.h"
 #include "update_engine/fake_clock.h"
@@ -16,7 +18,6 @@
 #include "update_engine/fake_prefs.h"
 #include "update_engine/fake_system_state.h"
 #include "update_engine/omaha_request_action.h"
-#include "update_engine/payload_state.h"
 #include "update_engine/prefs.h"
 #include "update_engine/prefs_mock.h"
 #include "update_engine/test_utils.h"
@@ -1101,21 +1102,15 @@
   PayloadState payload_state;
   FakeSystemState fake_system_state;
   FakeClock fake_clock;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
 
   // Set the clock to a well-known time - 1 second on the wall-clock
   // and 2 seconds on the monotonic clock
   fake_clock.SetWallclockTime(Time::FromInternalValue(1000000));
   fake_clock.SetMonotonicTime(Time::FromInternalValue(2000000));
 
-  // We need persistent preferences for this test
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateDurationTests.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-
   fake_system_state.set_clock(&fake_clock);
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
 
   // Check that durations are correct for a successful update where
@@ -1159,8 +1154,6 @@
   EXPECT_EQ(payload_state2.GetUpdateDuration().InMicroseconds(), 17000000);
   EXPECT_EQ(payload_state2.GetUpdateDurationUptime().InMicroseconds(),
             16000000);
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, RebootAfterSuccessfulUpdateTest) {
@@ -1168,20 +1161,14 @@
   PayloadState payload_state;
   FakeSystemState fake_system_state;
   FakeClock fake_clock;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
 
   // Set the clock to a well-known time (t = 30 seconds).
   fake_clock.SetWallclockTime(Time::FromInternalValue(
       30 * Time::kMicrosecondsPerSecond));
 
-  // We need persistent preferences for this test
-  EXPECT_TRUE(utils::MakeTempDirectory(
-      "RebootAfterSuccessfulUpdateTest.XXXXXX", &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-
   fake_system_state.set_clock(&fake_clock);
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
 
   // Make the update succeed.
@@ -1189,7 +1176,7 @@
   payload_state.UpdateSucceeded();
 
   // Check that the marker was written.
-  EXPECT_TRUE(prefs.Exists(kPrefsSystemUpdatedMarker));
+  EXPECT_TRUE(fake_prefs.Exists(kPrefsSystemUpdatedMarker));
 
   // Now simulate a reboot and set the wallclock time to a later point
   // (t = 500 seconds). We do this by using a new PayloadState object
@@ -1212,9 +1199,7 @@
   payload_state2.UpdateEngineStarted();
 
   // Check that the marker was nuked.
-  EXPECT_FALSE(prefs.Exists(kPrefsSystemUpdatedMarker));
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
+  EXPECT_FALSE(fake_prefs.Exists(kPrefsSystemUpdatedMarker));
 }
 
 TEST(PayloadStateTest, RestartAfterCrash) {
@@ -1261,12 +1246,12 @@
 TEST(PayloadStateTest, AbnormalTerminationAttemptMetricsReported) {
   PayloadState payload_state;
   FakeSystemState fake_system_state;
-  FakePrefs prefs;
+  FakePrefs fake_prefs;
 
   // If we have a marker at startup, ensure it's reported and the
   // marker is then cleared.
-  fake_system_state.set_prefs(&prefs);
-  prefs.SetBoolean(kPrefsAttemptInProgress, true);
+  fake_system_state.set_prefs(&fake_prefs);
+  fake_prefs.SetBoolean(kPrefsAttemptInProgress, true);
 
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
 
@@ -1277,18 +1262,18 @@
           _)).Times(1);
   payload_state.UpdateEngineStarted();
 
-  EXPECT_FALSE(prefs.Exists(kPrefsAttemptInProgress));
+  EXPECT_FALSE(fake_prefs.Exists(kPrefsAttemptInProgress));
 }
 
 TEST(PayloadStateTest, AbnormalTerminationAttemptMetricsClearedOnSucceess) {
   PayloadState payload_state;
   FakeSystemState fake_system_state;
-  FakePrefs prefs;
+  FakePrefs fake_prefs;
 
   // Make sure the marker is written and cleared during an attempt and
   // also that we DO NOT emit the metric (since the attempt didn't end
   // abnormally).
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
 
   EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(_, _, _, _, _))
@@ -1302,17 +1287,17 @@
           _)).Times(0);
 
   // Attempt not in progress, should be clear.
-  EXPECT_FALSE(prefs.Exists(kPrefsAttemptInProgress));
+  EXPECT_FALSE(fake_prefs.Exists(kPrefsAttemptInProgress));
 
   payload_state.UpdateRestarted();
 
   // Attempt not in progress, should be set.
-  EXPECT_TRUE(prefs.Exists(kPrefsAttemptInProgress));
+  EXPECT_TRUE(fake_prefs.Exists(kPrefsAttemptInProgress));
 
   payload_state.UpdateSucceeded();
 
   // Attempt not in progress, should be clear.
-  EXPECT_FALSE(prefs.Exists(kPrefsAttemptInProgress));
+  EXPECT_FALSE(fake_prefs.Exists(kPrefsAttemptInProgress));
 }
 
 TEST(PayloadStateTest, CandidateUrlsComputedCorrectly) {
@@ -1494,14 +1479,8 @@
   FakeSystemState fake_system_state;
   OmahaResponse response;
   PayloadState payload_state;
-  Prefs prefs;
-  string temp_dir;
-
-  // Setup an environment with persistent prefs across simulated reboots.
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateReboot.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-  fake_system_state.set_prefs(&prefs);
+  FakePrefs fake_prefs;
+  fake_system_state.set_prefs(&fake_prefs);
 
   FakeHardware* fake_hardware = fake_system_state.fake_hardware();
   fake_hardware->SetBootDevice("/dev/sda3");
@@ -1542,22 +1521,14 @@
       metrics::kMetricFailedUpdateCount, 1, _, _, _));
   payload_state.ReportFailedBootIfNeeded();
   Mock::VerifyAndClearExpectations(fake_system_state.mock_metrics_lib());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, RebootAfterUpdateSucceed) {
   FakeSystemState fake_system_state;
   OmahaResponse response;
   PayloadState payload_state;
-  Prefs prefs;
-  string temp_dir;
-
-  // Setup an environment with persistent prefs across simulated reboots.
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateReboot.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-  fake_system_state.set_prefs(&prefs);
+  FakePrefs fake_prefs;
+  fake_system_state.set_prefs(&fake_prefs);
 
   FakeHardware* fake_hardware = fake_system_state.fake_hardware();
   fake_hardware->SetBootDevice("/dev/sda3");
@@ -1585,23 +1556,15 @@
   payload_state.ReportFailedBootIfNeeded();
   fake_hardware->SetBootDevice("/dev/sda3");
   payload_state.ReportFailedBootIfNeeded();
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, RebootAfterCanceledUpdate) {
   FakeSystemState fake_system_state;
   OmahaResponse response;
   PayloadState payload_state;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
 
-  // Setup an environment with persistent prefs across simulated reboots.
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateReboot.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-  fake_system_state.set_prefs(&prefs);
-
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
   SetupPayloadStateWith2Urls("Hash3141", true, &payload_state, &response);
 
@@ -1622,22 +1585,14 @@
 
   // Simulate a reboot.
   payload_state.ReportFailedBootIfNeeded();
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, UpdateSuccessWithWipedPrefs) {
   FakeSystemState fake_system_state;
   PayloadState payload_state;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
 
-  // Setup an environment with persistent but initially empty prefs.
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateReboot.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-  fake_system_state.set_prefs(&prefs);
-
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
 
   EXPECT_CALL(*fake_system_state.mock_metrics_lib(), SendToUMA(
@@ -1649,23 +1604,15 @@
 
   // Simulate a reboot in this environment.
   payload_state.ReportFailedBootIfNeeded();
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, DisallowP2PAfterTooManyAttempts) {
   OmahaResponse response;
   PayloadState payload_state;
   FakeSystemState fake_system_state;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
+  fake_system_state.set_prefs(&fake_prefs);
 
-  // We need persistent preferences for this test.
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-
-  fake_system_state.set_prefs(&prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
   SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
 
@@ -1677,8 +1624,6 @@
   // ... but not more than that.
   payload_state.P2PNewAttempt();
   EXPECT_FALSE(payload_state.P2PAttemptAllowed());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, DisallowP2PAfterDeadline) {
@@ -1686,16 +1631,10 @@
   PayloadState payload_state;
   FakeSystemState fake_system_state;
   FakeClock fake_clock;
-  Prefs prefs;
-  string temp_dir;
-
-  // We need persistent preferences for this test.
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
+  FakePrefs fake_prefs;
 
   fake_system_state.set_clock(&fake_clock);
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
   SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
 
@@ -1730,29 +1669,21 @@
   fake_clock.SetWallclockTime(epoch +
       TimeDelta::FromSeconds(kMaxP2PAttemptTimeSeconds + 1));
   EXPECT_FALSE(payload_state.P2PAttemptAllowed());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, P2PStateVarsInitialValue) {
   OmahaResponse response;
   PayloadState payload_state;
   FakeSystemState fake_system_state;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
 
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
   SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
 
   Time null_time = Time();
   EXPECT_EQ(null_time, payload_state.GetP2PFirstAttemptTimestamp());
   EXPECT_EQ(0, payload_state.GetP2PNumAttempts());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, P2PStateVarsArePersisted) {
@@ -1760,14 +1691,9 @@
   PayloadState payload_state;
   FakeSystemState fake_system_state;
   FakeClock fake_clock;
-  Prefs prefs;
-  string temp_dir;
-
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
+  FakePrefs fake_prefs;
   fake_system_state.set_clock(&fake_clock);
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
   SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
 
@@ -1786,8 +1712,6 @@
   EXPECT_TRUE(payload_state2.Initialize(&fake_system_state));
   EXPECT_EQ(1, payload_state2.GetP2PNumAttempts());
   EXPECT_EQ(time, payload_state2.GetP2PFirstAttemptTimestamp());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(PayloadStateTest, P2PStateVarsAreClearedOnNewResponse) {
@@ -1795,14 +1719,10 @@
   PayloadState payload_state;
   FakeSystemState fake_system_state;
   FakeClock fake_clock;
-  Prefs prefs;
-  string temp_dir;
-
-  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
+  FakePrefs fake_prefs;
   fake_system_state.set_clock(&fake_clock);
-  fake_system_state.set_prefs(&prefs);
+  fake_system_state.set_prefs(&fake_prefs);
+
   EXPECT_TRUE(payload_state.Initialize(&fake_system_state));
   SetupPayloadStateWith2Urls("Hash8593", true, &payload_state, &response);
 
@@ -1822,8 +1742,6 @@
   Time null_time = Time();
   EXPECT_EQ(0, payload_state.GetP2PNumAttempts());
   EXPECT_EQ(null_time, payload_state.GetP2PFirstAttemptTimestamp());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 }  // namespace chromeos_update_engine
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 6dc921b..b01fbda 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "update_engine/update_attempter.h"
+
 #include <stdint.h>
 
 #include <memory>
@@ -14,6 +16,7 @@
 #include "update_engine/action_mock.h"
 #include "update_engine/action_processor_mock.h"
 #include "update_engine/fake_clock.h"
+#include "update_engine/fake_prefs.h"
 #include "update_engine/fake_system_state.h"
 #include "update_engine/filesystem_copier_action.h"
 #include "update_engine/install_plan.h"
@@ -25,7 +28,6 @@
 #include "update_engine/prefs.h"
 #include "update_engine/prefs_mock.h"
 #include "update_engine/test_utils.h"
-#include "update_engine/update_attempter.h"
 #include "update_engine/utils.h"
 
 using base::Time;
@@ -37,9 +39,9 @@
 using testing::Ne;
 using testing::NiceMock;
 using testing::Property;
-using testing::SaveArg;
 using testing::Return;
 using testing::ReturnPointee;
+using testing::SaveArg;
 using testing::SetArgumentPointee;
 using testing::_;
 
@@ -198,7 +200,7 @@
   NiceMock<MockDBusWrapper> dbus_;
   UpdateAttempterUnderTest attempter_;
   NiceMock<ActionProcessorMock>* processor_;
-  NiceMock<PrefsMock>* prefs_;  // shortcut to fake_system_state_->mock_prefs()
+  NiceMock<PrefsMock>* prefs_;  // Shortcut to fake_system_state_->mock_prefs().
   NiceMock<MockConnectionManager> mock_connection_manager;
   GMainLoop* loop_;
 
@@ -859,19 +861,12 @@
   // Tests that the scatter_factor_in_seconds value is properly fetched
   // from the device policy and is decremented if value > 0.
   int64_t initial_value = 5;
-  Prefs prefs;
-  attempter_.prefs_ = &prefs;
+  FakePrefs fake_prefs;
+  attempter_.prefs_ = &fake_prefs;
 
   fake_system_state_.fake_hardware()->SetIsOOBEComplete(Time::UnixEpoch());
 
-  string prefs_dir;
-  EXPECT_TRUE(utils::MakeTempDirectory("ue_ut_prefs.XXXXXX",
-                                       &prefs_dir));
-  ScopedDirRemover temp_dir_remover(prefs_dir);
-
-  LOG_IF(ERROR, !prefs.Init(base::FilePath(prefs_dir)))
-      << "Failed to initialize preferences.";
-  EXPECT_TRUE(prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
+  EXPECT_TRUE(fake_prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
 
   int64_t scatter_factor_in_seconds = 10;
 
@@ -890,10 +885,10 @@
   EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds());
 
   // Make sure the file still exists.
-  EXPECT_TRUE(prefs.Exists(kPrefsUpdateCheckCount));
+  EXPECT_TRUE(fake_prefs.Exists(kPrefsUpdateCheckCount));
 
   int64_t new_value;
-  EXPECT_TRUE(prefs.GetInt64(kPrefsUpdateCheckCount, &new_value));
+  EXPECT_TRUE(fake_prefs.GetInt64(kPrefsUpdateCheckCount, &new_value));
   EXPECT_EQ(initial_value - 1, new_value);
 
   EXPECT_TRUE(
@@ -901,10 +896,10 @@
 
   // However, if the count is already 0, it's not decremented. Test that.
   initial_value = 0;
-  EXPECT_TRUE(prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
+  EXPECT_TRUE(fake_prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
   attempter_.Update("", "", "", "", false, false);
-  EXPECT_TRUE(prefs.Exists(kPrefsUpdateCheckCount));
-  EXPECT_TRUE(prefs.GetInt64(kPrefsUpdateCheckCount, &new_value));
+  EXPECT_TRUE(fake_prefs.Exists(kPrefsUpdateCheckCount));
+  EXPECT_TRUE(fake_prefs.GetInt64(kPrefsUpdateCheckCount, &new_value));
   EXPECT_EQ(initial_value, new_value);
 
   g_idle_add(&StaticQuitMainLoop, this);
@@ -922,20 +917,14 @@
   // Tests that no scattering logic is enabled if the update check
   // is manually done (as opposed to a scheduled update check)
   int64_t initial_value = 8;
-  Prefs prefs;
-  attempter_.prefs_ = &prefs;
+  FakePrefs fake_prefs;
+  attempter_.prefs_ = &fake_prefs;
 
   fake_system_state_.fake_hardware()->SetIsOOBEComplete(Time::UnixEpoch());
+  fake_system_state_.set_prefs(&fake_prefs);
 
-  string prefs_dir;
-  EXPECT_TRUE(utils::MakeTempDirectory("ue_ut_prefs.XXXXXX",
-                                       &prefs_dir));
-  ScopedDirRemover temp_dir_remover(prefs_dir);
-
-  LOG_IF(ERROR, !prefs.Init(base::FilePath(prefs_dir)))
-      << "Failed to initialize preferences.";
-  EXPECT_TRUE(prefs.SetInt64(kPrefsWallClockWaitPeriod, initial_value));
-  EXPECT_TRUE(prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
+  EXPECT_TRUE(fake_prefs.SetInt64(kPrefsWallClockWaitPeriod, initial_value));
+  EXPECT_TRUE(fake_prefs.SetInt64(kPrefsUpdateCheckCount, initial_value));
 
   // make sure scatter_factor is non-zero as scattering is disabled
   // otherwise.
@@ -960,11 +949,11 @@
   // checks and all artifacts are removed.
   EXPECT_FALSE(
       attempter_.omaha_request_params_->wall_clock_based_wait_enabled());
-  EXPECT_FALSE(prefs.Exists(kPrefsWallClockWaitPeriod));
+  EXPECT_FALSE(fake_prefs.Exists(kPrefsWallClockWaitPeriod));
   EXPECT_EQ(0, attempter_.omaha_request_params_->waiting_period().InSeconds());
   EXPECT_FALSE(
       attempter_.omaha_request_params_->update_check_count_wait_enabled());
-  EXPECT_FALSE(prefs.Exists(kPrefsUpdateCheckCount));
+  EXPECT_FALSE(fake_prefs.Exists(kPrefsUpdateCheckCount));
 
   g_idle_add(&StaticQuitMainLoop, this);
 }
@@ -972,15 +961,10 @@
 // Checks that we only report daily metrics at most every 24 hours.
 TEST_F(UpdateAttempterTest, ReportDailyMetrics) {
   FakeClock fake_clock;
-  Prefs prefs;
-  string temp_dir;
+  FakePrefs fake_prefs;
 
-  // We need persistent preferences for this test
-  EXPECT_TRUE(utils::MakeTempDirectory("UpdateAttempterTest.XXXXXX",
-                                       &temp_dir));
-  prefs.Init(base::FilePath(temp_dir));
   fake_system_state_.set_clock(&fake_clock);
-  fake_system_state_.set_prefs(&prefs);
+  fake_system_state_.set_prefs(&fake_prefs);
 
   Time epoch = Time::FromInternalValue(0);
   fake_clock.SetWallclockTime(epoch);
@@ -1036,8 +1020,6 @@
   fake_clock.SetWallclockTime(epoch + TimeDelta::FromHours(95));
   EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics());
   EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics());
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST_F(UpdateAttempterTest, BootTimeInUpdateMarkerFile) {
diff --git a/utils_unittest.cc b/utils_unittest.cc
index 832c2af..44d1b87 100644
--- a/utils_unittest.cc
+++ b/utils_unittest.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "update_engine/utils.h"
+
 #include <errno.h>
 #include <stdint.h>
 #include <sys/stat.h>
@@ -11,17 +13,17 @@
 #include <string>
 #include <vector>
 
-#include <base/files/file_util.h>
 #include <base/files/file_path.h>
+#include <base/files/file_util.h>
 #include <base/strings/string_util.h>
 #include <base/strings/stringprintf.h>
 #include <gtest/gtest.h>
 
 #include "update_engine/fake_clock.h"
+#include "update_engine/fake_prefs.h"
 #include "update_engine/fake_system_state.h"
 #include "update_engine/prefs.h"
 #include "update_engine/test_utils.h"
-#include "update_engine/utils.h"
 
 using std::map;
 using std::string;
@@ -571,11 +573,7 @@
   FakeClock fake_clock;
   base::TimeDelta duration;
   string state_variable_key = "test-prefs";
-  string temp_dir;
-  Prefs fake_prefs;
-
-  EXPECT_TRUE(utils::MakeTempDirectory("DurationPrefs.XXXXXX", &temp_dir));
-  fake_prefs.Init(base::FilePath(temp_dir));
+  FakePrefs fake_prefs;
 
   fake_system_state.set_clock(&fake_clock);
   fake_system_state.set_prefs(&fake_prefs);
@@ -640,8 +638,6 @@
                                              state_variable_key,
                                              &duration));
   EXPECT_EQ(duration.InSeconds(), 1);
-
-  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
 TEST(UtilsTest, MonotonicDurationHelper) {
