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 22 matching lines...) Expand all Loading... |
33 namespace { | 33 namespace { |
34 const char* kTestDir = "/tmp/update_engine-integration-test"; | 34 const char* kTestDir = "/tmp/update_engine-integration-test"; |
35 | 35 |
36 class IntegrationTestProcessorDelegate : public ActionProcessorDelegate { | 36 class IntegrationTestProcessorDelegate : public ActionProcessorDelegate { |
37 public: | 37 public: |
38 IntegrationTestProcessorDelegate() | 38 IntegrationTestProcessorDelegate() |
39 : loop_(NULL), processing_done_called_(false) {} | 39 : loop_(NULL), processing_done_called_(false) {} |
40 virtual ~IntegrationTestProcessorDelegate() { | 40 virtual ~IntegrationTestProcessorDelegate() { |
41 EXPECT_TRUE(processing_done_called_); | 41 EXPECT_TRUE(processing_done_called_); |
42 } | 42 } |
43 virtual void ProcessingDone(const ActionProcessor* processor) { | 43 virtual void ProcessingDone(const ActionProcessor* processor, bool success) { |
44 processing_done_called_ = true; | 44 processing_done_called_ = true; |
45 g_main_loop_quit(loop_); | 45 g_main_loop_quit(loop_); |
46 } | 46 } |
47 | 47 |
48 virtual void ActionCompleted(ActionProcessor* processor, | 48 virtual void ActionCompleted(ActionProcessor* processor, |
49 AbstractAction* action, | 49 AbstractAction* action, |
50 bool success) { | 50 bool success) { |
51 // make sure actions always succeed | 51 // make sure actions always succeed |
52 EXPECT_TRUE(success); | 52 EXPECT_TRUE(success); |
53 | 53 |
(...skipping 129 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 |