| Index: components/update_client/update_client_unittest.cc
|
| diff --git a/components/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc
|
| index 73e9e9d8e2128b30fca147887e7cca19e92bd30e..fae978c077533b23fa0df6fe9857557d54164883 100644
|
| --- a/components/update_client/update_client_unittest.cc
|
| +++ b/components/update_client/update_client_unittest.cc
|
| @@ -1370,13 +1370,24 @@ TEST_F(UpdateClientTest, OneCrxInstallError) {
|
| bool(const std::string& file, base::FilePath* installed_file));
|
| MOCK_METHOD0(Uninstall, bool());
|
|
|
| - static void OnInstall(const base::DictionaryValue& manifest,
|
| - const base::FilePath& unpack_path) {
|
| - base::DeleteFile(unpack_path, true);
|
| + void OnInstall(const base::DictionaryValue& manifest,
|
| + const base::FilePath& unpack_path) {
|
| + unpack_path_ = unpack_path;
|
| + EXPECT_TRUE(base::DirectoryExists(unpack_path_));
|
| }
|
|
|
| protected:
|
| - ~MockInstaller() override {}
|
| + ~MockInstaller() override {
|
| + // The unpack path is deleted unconditionally by the component state code,
|
| + // which is driving this installer. Therefore, the unpack path must not
|
| + // exist when this object is destroyed.
|
| + if (!unpack_path_.empty())
|
| + EXPECT_FALSE(base::DirectoryExists(unpack_path_));
|
| + }
|
| +
|
| + private:
|
| + // Contains the |unpack_path| argument of the Install call.
|
| + base::FilePath unpack_path_;
|
| };
|
|
|
| class DataCallbackFake {
|
| @@ -1389,7 +1400,7 @@ TEST_F(UpdateClientTest, OneCrxInstallError) {
|
| EXPECT_CALL(*installer, OnUpdateError(_)).Times(0);
|
| EXPECT_CALL(*installer, Install(_, _))
|
| .WillOnce(
|
| - DoAll(Invoke(MockInstaller::OnInstall),
|
| + DoAll(Invoke(installer.get(), &MockInstaller::OnInstall),
|
| Return(CrxInstaller::Result(InstallError::GENERIC_ERROR))));
|
| EXPECT_CALL(*installer, GetInstalledFile(_, _)).Times(0);
|
| EXPECT_CALL(*installer, Uninstall()).Times(0);
|
|
|