update_engine: Standarize mock/fake filenames.
Mock classes implement mostly MOCK_METHOD* methods used with gmock.
Those classes should be named with the prefix "Mock" in the class
name and "mock_" in the header filename.
Fake classes implement a working version of the interface they provide,
often with extra functionality to change their behavior. Those classes
should be prefixed with "Fake" in the class name and "fake_" in the
file name.
Other minor include order fixes are included in this patch.
BUG=None
TEST=Unittest still pass.
Change-Id: I23de7cb11e25182d5855afacca47d431c97b82bb
Reviewed-on: https://chromium-review.googlesource.com/227779
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index b01fbda..d2b1e14 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -13,20 +13,20 @@
#include <policy/libpolicy.h>
#include <policy/mock_device_policy.h>
-#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"
+#include "update_engine/mock_action.h"
+#include "update_engine/mock_action_processor.h"
#include "update_engine/mock_dbus_wrapper.h"
#include "update_engine/mock_http_fetcher.h"
#include "update_engine/mock_p2p_manager.h"
#include "update_engine/mock_payload_state.h"
+#include "update_engine/mock_prefs.h"
#include "update_engine/postinstall_runner_action.h"
#include "update_engine/prefs.h"
-#include "update_engine/prefs_mock.h"
#include "update_engine/test_utils.h"
#include "update_engine/utils.h"
@@ -119,7 +119,7 @@
EXPECT_EQ(0, attempter_.last_checked_time_);
EXPECT_EQ("0.0.0.0", attempter_.new_version_);
EXPECT_EQ(0, attempter_.new_payload_size_);
- processor_ = new NiceMock<ActionProcessorMock>();
+ processor_ = new NiceMock<MockActionProcessor>();
attempter_.processor_.reset(processor_); // Transfers ownership.
prefs_ = fake_system_state_.mock_prefs();
@@ -199,8 +199,8 @@
FakeSystemState fake_system_state_;
NiceMock<MockDBusWrapper> dbus_;
UpdateAttempterUnderTest attempter_;
- NiceMock<ActionProcessorMock>* processor_;
- NiceMock<PrefsMock>* prefs_; // Shortcut to fake_system_state_->mock_prefs().
+ NiceMock<MockActionProcessor>* processor_;
+ NiceMock<MockPrefs>* prefs_; // Shortcut to fake_system_state_->mock_prefs().
NiceMock<MockConnectionManager> mock_connection_manager;
GMainLoop* loop_;
@@ -222,8 +222,8 @@
}
TEST_F(UpdateAttempterTest, ActionCompletedErrorTest) {
- ActionMock action;
- EXPECT_CALL(action, Type()).WillRepeatedly(Return("ActionMock"));
+ MockAction action;
+ EXPECT_CALL(action, Type()).WillRepeatedly(Return("MockAction"));
attempter_.status_ = UPDATE_STATUS_DOWNLOADING;
EXPECT_CALL(*prefs_, GetInt64(kPrefsDeltaUpdateFailures, _))
.WillOnce(Return(false));
@@ -286,8 +286,8 @@
EXPECT_EQ(ErrorCode::kPostinstallRunnerError,
GetErrorCodeForAction(&postinstall_runner_action,
ErrorCode::kError));
- ActionMock action_mock;
- EXPECT_CALL(action_mock, Type()).WillOnce(Return("ActionMock"));
+ MockAction action_mock;
+ EXPECT_CALL(action_mock, Type()).WillOnce(Return("MockAction"));
EXPECT_EQ(ErrorCode::kError,
GetErrorCodeForAction(&action_mock, ErrorCode::kError));
}
@@ -627,7 +627,7 @@
}
TEST_F(UpdateAttempterTest, CreatePendingErrorEventTest) {
- ActionMock action;
+ MockAction action;
const ErrorCode kCode = ErrorCode::kDownloadTransferError;
attempter_.CreatePendingErrorEvent(&action, kCode);
ASSERT_NE(nullptr, attempter_.error_event_.get());
@@ -644,7 +644,7 @@
new OmahaResponseHandlerAction(&fake_system_state_);
response_action->install_plan_.is_resume = true;
attempter_.response_handler_action_.reset(response_action);
- ActionMock action;
+ MockAction action;
const ErrorCode kCode = ErrorCode::kInstallDeviceOpenError;
attempter_.CreatePendingErrorEvent(&action, kCode);
ASSERT_NE(nullptr, attempter_.error_event_.get());