OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <base/file_util.h> | 5 #include <base/file_util.h> |
6 #include <gtest/gtest.h> | 6 #include <gtest/gtest.h> |
7 | 7 |
8 #include "update_engine/action_mock.h" | 8 #include "update_engine/action_mock.h" |
9 #include "update_engine/action_processor_mock.h" | 9 #include "update_engine/action_processor_mock.h" |
10 #include "update_engine/filesystem_copier_action.h" | 10 #include "update_engine/filesystem_copier_action.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 TEST_F(UpdateAttempterTest, GetErrorCodeForActionTest) { | 71 TEST_F(UpdateAttempterTest, GetErrorCodeForActionTest) { |
72 extern ActionExitCode GetErrorCodeForAction(AbstractAction* action, | 72 extern ActionExitCode GetErrorCodeForAction(AbstractAction* action, |
73 ActionExitCode code); | 73 ActionExitCode code); |
74 EXPECT_EQ(kActionCodeSuccess, | 74 EXPECT_EQ(kActionCodeSuccess, |
75 GetErrorCodeForAction(NULL, kActionCodeSuccess)); | 75 GetErrorCodeForAction(NULL, kActionCodeSuccess)); |
76 | 76 |
77 OmahaRequestParams params; | 77 OmahaRequestParams params; |
78 OmahaRequestAction omaha_request_action(NULL, params, NULL, NULL); | 78 OmahaRequestAction omaha_request_action(NULL, params, NULL, NULL); |
79 EXPECT_EQ(kActionCodeOmahaRequestError, | 79 EXPECT_EQ(kActionCodeOmahaRequestError, |
80 GetErrorCodeForAction(&omaha_request_action, kActionCodeError)); | 80 GetErrorCodeForAction(&omaha_request_action, kActionCodeError)); |
81 OmahaResponseHandlerAction omaha_response_handler_action; | 81 OmahaResponseHandlerAction omaha_response_handler_action(&prefs_); |
82 EXPECT_EQ(kActionCodeOmahaResponseHandlerError, | 82 EXPECT_EQ(kActionCodeOmahaResponseHandlerError, |
83 GetErrorCodeForAction(&omaha_response_handler_action, | 83 GetErrorCodeForAction(&omaha_response_handler_action, |
84 kActionCodeError)); | 84 kActionCodeError)); |
85 FilesystemCopierAction filesystem_copier_action(false); | 85 FilesystemCopierAction filesystem_copier_action(false); |
86 EXPECT_EQ(kActionCodeFilesystemCopierError, | 86 EXPECT_EQ(kActionCodeFilesystemCopierError, |
87 GetErrorCodeForAction(&filesystem_copier_action, kActionCodeError)); | 87 GetErrorCodeForAction(&filesystem_copier_action, kActionCodeError)); |
88 PostinstallRunnerAction postinstall_runner_action(true); | 88 PostinstallRunnerAction postinstall_runner_action(true); |
89 EXPECT_EQ(kActionCodePostinstallRunnerError, | 89 EXPECT_EQ(kActionCodePostinstallRunnerError, |
90 GetErrorCodeForAction(&postinstall_runner_action, | 90 GetErrorCodeForAction(&postinstall_runner_action, |
91 kActionCodeError)); | 91 kActionCodeError)); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 EXPECT_EQ(attempter_.response_handler_action_.get(), | 195 EXPECT_EQ(attempter_.response_handler_action_.get(), |
196 attempter_.actions_[1].get()); | 196 attempter_.actions_[1].get()); |
197 DownloadAction* download_action = | 197 DownloadAction* download_action = |
198 dynamic_cast<DownloadAction*>(attempter_.actions_[5].get()); | 198 dynamic_cast<DownloadAction*>(attempter_.actions_[5].get()); |
199 ASSERT_TRUE(download_action != NULL); | 199 ASSERT_TRUE(download_action != NULL); |
200 EXPECT_EQ(&attempter_, download_action->delegate()); | 200 EXPECT_EQ(&attempter_, download_action->delegate()); |
201 EXPECT_EQ(UPDATE_STATUS_CHECKING_FOR_UPDATE, attempter_.status()); | 201 EXPECT_EQ(UPDATE_STATUS_CHECKING_FOR_UPDATE, attempter_.status()); |
202 } | 202 } |
203 | 203 |
204 } // namespace chromeos_update_engine | 204 } // namespace chromeos_update_engine |
OLD | NEW |