Chromium Code Reviews| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 } | 292 } |
| 293 | 293 |
| 294 TEST_F(UpdateAttempterTest, UpdateTest) { | 294 TEST_F(UpdateAttempterTest, UpdateTest) { |
| 295 loop_ = g_main_loop_new(g_main_context_default(), FALSE); | 295 loop_ = g_main_loop_new(g_main_context_default(), FALSE); |
| 296 g_idle_add(&StaticUpdateTestStart, this); | 296 g_idle_add(&StaticUpdateTestStart, this); |
| 297 g_main_loop_run(loop_); | 297 g_main_loop_run(loop_); |
| 298 g_main_loop_unref(loop_); | 298 g_main_loop_unref(loop_); |
| 299 loop_ = NULL; | 299 loop_ = NULL; |
| 300 } | 300 } |
| 301 | 301 |
| 302 TEST_F(UpdateAttempterTest, PingOmahaTest) { | |
|
adlr
2011/04/15 22:04:51
you should probably set up a GMainLoop in here and
thieule
2011/04/15 23:32:57
Done.
| |
| 303 EXPECT_CALL(*processor_, | |
| 304 EnqueueAction(Property(&AbstractAction::Type, | |
| 305 OmahaRequestAction::StaticType()))) | |
| 306 .Times(1); | |
| 307 EXPECT_CALL(*processor_, StartProcessing()).Times(1); | |
| 308 UpdateCheckScheduler scheduler(&attempter_); | |
| 309 scheduler.enabled_ = true; | |
| 310 EXPECT_EQ(false, scheduler.scheduled_); | |
| 311 attempter_.set_update_check_scheduler(&scheduler); | |
| 312 attempter_.PingOmaha(); | |
| 313 EXPECT_EQ(UPDATE_STATUS_UPDATED_NEED_REBOOT, attempter_.status()); | |
| 314 EXPECT_EQ(true, scheduler.scheduled_); | |
| 315 } | |
| 316 | |
| 302 } // namespace chromeos_update_engine | 317 } // namespace chromeos_update_engine |
| OLD | NEW |