Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: src/platform/update_engine/filesystem_copier_action_unittest.cc

Issue 1694025: AU: Update Downloader to support our image formats. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/update_engine/filesystem_copier_action.cc ('k') | src/platform/update_engine/install_plan.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/update_engine/filesystem_copier_action_unittest.cc
diff --git a/src/platform/update_engine/filesystem_copier_action_unittest.cc b/src/platform/update_engine/filesystem_copier_action_unittest.cc
index 3ccea2bc7df79b96f417913ebff79421a948ec6d..6b438173712d03d96000e8e78491c6da487dabc2 100644
--- a/src/platform/update_engine/filesystem_copier_action_unittest.cc
+++ b/src/platform/update_engine/filesystem_copier_action_unittest.cc
@@ -22,7 +22,9 @@ namespace chromeos_update_engine {
class FilesystemCopierActionTest : public ::testing::Test {
protected:
- void DoTest(bool run_out_of_space, bool terminate_early);
+ void DoTest(bool run_out_of_space,
+ bool terminate_early,
+ bool use_kernel_partition);
void SetUp() {
}
void TearDown() {
@@ -83,10 +85,13 @@ gboolean StartProcessorInRunLoop(gpointer data) {
TEST_F(FilesystemCopierActionTest, RunAsRootSimpleTest) {
ASSERT_EQ(0, getuid());
- DoTest(false, false);
+ DoTest(false, false, false);
+
+ DoTest(false, false, true);
}
void FilesystemCopierActionTest::DoTest(bool run_out_of_space,
- bool terminate_early) {
+ bool terminate_early,
+ bool use_kernel_partition) {
GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE);
string a_loop_file;
@@ -132,7 +137,10 @@ void FilesystemCopierActionTest::DoTest(bool run_out_of_space,
// Set up the action objects
InstallPlan install_plan;
install_plan.is_full_update = false;
- install_plan.install_path = b_dev;
+ if (use_kernel_partition)
+ install_plan.kernel_install_path = b_dev;
+ else
+ install_plan.install_path = b_dev;
ActionProcessor processor;
FilesystemCopierActionTestDelegate delegate;
@@ -140,7 +148,7 @@ void FilesystemCopierActionTest::DoTest(bool run_out_of_space,
processor.set_delegate(&delegate);
ObjectFeederAction<InstallPlan> feeder_action;
- FilesystemCopierAction copier_action;
+ FilesystemCopierAction copier_action(use_kernel_partition);
ObjectCollectorAction<InstallPlan> collector_action;
BondActions(&feeder_action, &copier_action);
@@ -202,7 +210,7 @@ TEST_F(FilesystemCopierActionTest, MissingInputObjectTest) {
processor.set_delegate(&delegate);
- FilesystemCopierAction copier_action;
+ FilesystemCopierAction copier_action(false);
ObjectCollectorAction<InstallPlan> collector_action;
BondActions(&copier_action, &collector_action);
@@ -222,9 +230,9 @@ TEST_F(FilesystemCopierActionTest, FullUpdateTest) {
processor.set_delegate(&delegate);
ObjectFeederAction<InstallPlan> feeder_action;
- InstallPlan install_plan(true, "", "", "");
+ InstallPlan install_plan(true, "", "", "", "");
feeder_action.set_obj(install_plan);
- FilesystemCopierAction copier_action;
+ FilesystemCopierAction copier_action(false);
ObjectCollectorAction<InstallPlan> collector_action;
BondActions(&feeder_action, &copier_action);
@@ -246,9 +254,9 @@ TEST_F(FilesystemCopierActionTest, NonExistentDriveTest) {
processor.set_delegate(&delegate);
ObjectFeederAction<InstallPlan> feeder_action;
- InstallPlan install_plan(false, "", "", "/some/missing/file/path");
+ InstallPlan install_plan(false, "", "", "/no/such/file", "/no/such/file");
feeder_action.set_obj(install_plan);
- FilesystemCopierAction copier_action;
+ FilesystemCopierAction copier_action(false);
ObjectCollectorAction<InstallPlan> collector_action;
BondActions(&copier_action, &collector_action);
@@ -264,12 +272,12 @@ TEST_F(FilesystemCopierActionTest, NonExistentDriveTest) {
TEST_F(FilesystemCopierActionTest, RunAsRootNoSpaceTest) {
ASSERT_EQ(0, getuid());
- DoTest(true, false);
+ DoTest(true, false, false);
}
TEST_F(FilesystemCopierActionTest, RunAsRootTerminateEarlyTest) {
ASSERT_EQ(0, getuid());
- DoTest(false, true);
+ DoTest(false, true, false);
}
} // namespace chromeos_update_engine
« no previous file with comments | « src/platform/update_engine/filesystem_copier_action.cc ('k') | src/platform/update_engine/install_plan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698