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

Side by Side Diff: update_attempter_unittest.cc

Issue 6836025: Add support to update_engine to poke Omaha after an update has been applied (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Change to use <ping> element with active=1 Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« update_attempter.cc ('K') | « update_attempter.cc ('k') | update_check_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698