OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 #include <glib.h> | 7 #include <glib.h> |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #include <gtest/gtest.h> | 9 #include <gtest/gtest.h> |
10 #include "update_engine/download_action.h" | 10 #include "update_engine/download_action.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 ASSERT_EQ(0, getuid()); | 98 ASSERT_EQ(0, getuid()); |
99 GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE); | 99 GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE); |
100 | 100 |
101 ActionProcessor processor; | 101 ActionProcessor processor; |
102 IntegrationTestProcessorDelegate delegate; | 102 IntegrationTestProcessorDelegate delegate; |
103 delegate.set_loop(loop); | 103 delegate.set_loop(loop); |
104 processor.set_delegate(&delegate); | 104 processor.set_delegate(&delegate); |
105 | 105 |
106 // Actions: | 106 // Actions: |
107 OmahaRequestPrepAction request_prep_action(false); | 107 OmahaRequestPrepAction request_prep_action(false); |
108 OmahaRequestAction update_check_action(new LibcurlHttpFetcher); | 108 OmahaRequestAction update_check_action(NULL, new LibcurlHttpFetcher); |
109 OmahaResponseHandlerAction response_handler_action; | 109 OmahaResponseHandlerAction response_handler_action; |
110 DownloadAction download_action(new LibcurlHttpFetcher); | 110 DownloadAction download_action(new LibcurlHttpFetcher); |
111 InstallAction install_action; | 111 InstallAction install_action; |
112 PostinstallRunnerAction postinstall_runner_action; | 112 PostinstallRunnerAction postinstall_runner_action; |
113 SetBootableFlagAction set_bootable_flag_action; | 113 SetBootableFlagAction set_bootable_flag_action; |
114 | 114 |
115 // Enqueue the actions | 115 // Enqueue the actions |
116 processor.EnqueueAction(&request_prep_action); | 116 processor.EnqueueAction(&request_prep_action); |
117 processor.EnqueueAction(&update_check_action); | 117 processor.EnqueueAction(&update_check_action); |
118 processor.EnqueueAction(&response_handler_action); | 118 processor.EnqueueAction(&response_handler_action); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 "/tmp/update_engine_test_postinst_out.txt", | 183 "/tmp/update_engine_test_postinst_out.txt", |
184 &file_data)); | 184 &file_data)); |
185 EXPECT_EQ("POSTINST_DONE\n", file_data); | 185 EXPECT_EQ("POSTINST_DONE\n", file_data); |
186 | 186 |
187 // cleanup | 187 // cleanup |
188 ASSERT_EQ(0, System(string("rm -rf ") + kTestDir)); | 188 ASSERT_EQ(0, System(string("rm -rf ") + kTestDir)); |
189 ASSERT_EQ(0, system("rm -f /tmp/update_engine_test_postinst_out.txt")); | 189 ASSERT_EQ(0, system("rm -f /tmp/update_engine_test_postinst_out.txt")); |
190 } | 190 } |
191 | 191 |
192 } // namespace chromeos_update_engine | 192 } // namespace chromeos_update_engine |
OLD | NEW |