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 <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
9 #include "update_engine/action_pipe.h" | 9 #include "update_engine/action_pipe.h" |
10 #include "update_engine/update_check_action.h" | 10 #include "update_engine/update_check_action.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 "size=\"" + size + "\" status=\"ok\"/></app></gupdate>"; | 47 "size=\"" + size + "\" status=\"ok\"/></app></gupdate>"; |
48 } | 48 } |
49 | 49 |
50 class UpdateCheckActionTestProcessorDelegate : public ActionProcessorDelegate { | 50 class UpdateCheckActionTestProcessorDelegate : public ActionProcessorDelegate { |
51 public: | 51 public: |
52 UpdateCheckActionTestProcessorDelegate() | 52 UpdateCheckActionTestProcessorDelegate() |
53 : loop_(NULL), | 53 : loop_(NULL), |
54 expected_success_(true) {} | 54 expected_success_(true) {} |
55 virtual ~UpdateCheckActionTestProcessorDelegate() { | 55 virtual ~UpdateCheckActionTestProcessorDelegate() { |
56 } | 56 } |
57 virtual void ProcessingDone(const ActionProcessor* processor) { | 57 virtual void ProcessingDone(const ActionProcessor* processor, bool success) { |
58 ASSERT_TRUE(loop_); | 58 ASSERT_TRUE(loop_); |
59 g_main_loop_quit(loop_); | 59 g_main_loop_quit(loop_); |
60 } | 60 } |
61 | 61 |
62 virtual void ActionCompleted(ActionProcessor* processor, | 62 virtual void ActionCompleted(ActionProcessor* processor, |
63 AbstractAction* action, | 63 AbstractAction* action, |
64 bool success) { | 64 bool success) { |
65 // make sure actions always succeed | 65 // make sure actions always succeed |
66 if (action->Type() == UpdateCheckAction::StaticType()) | 66 if (action->Type() == UpdateCheckAction::StaticType()) |
67 EXPECT_EQ(expected_success_, success); | 67 EXPECT_EQ(expected_success_, success); |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // overflows int32: | 503 // overflows int32: |
504 "123123123123123"), // size | 504 "123123123123123"), // size |
505 true, | 505 true, |
506 &response, | 506 &response, |
507 NULL)); | 507 NULL)); |
508 | 508 |
509 EXPECT_EQ(response.size, 123123123123123ll); | 509 EXPECT_EQ(response.size, 123123123123123ll); |
510 } | 510 } |
511 | 511 |
512 } // namespace chromeos_update_engine | 512 } // namespace chromeos_update_engine |
OLD | NEW |