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

Unified Diff: omaha_request_action_unittest.cc

Issue 6677146: AU: OmahaRequestAction: allow to be skipped. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fix include "" vs <> Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « omaha_request_action.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: omaha_request_action_unittest.cc
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index ece5a7d7ecb0be9ed7e5722fcfffb3c3fdf7a94a..409e947a44d5718e62681e9571267aef7c2967a2 100755
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -283,6 +283,32 @@ TEST(OmahaRequestActionTest, NoOutputPipeTest) {
EXPECT_FALSE(processor.IsRunning());
}
+TEST(OmahaRequestActionTest, SkipTest) {
+ const string http_response("invalid xml>");
+
+ GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE);
+
+ NiceMock<PrefsMock> prefs;
+ MockHttpFetcher* fetcher = new MockHttpFetcher(http_response.data(),
+ http_response.size(),
+ NULL);
+ fetcher->set_never_use(true);
+ OmahaRequestAction action(&prefs, kDefaultTestParams,
+ new OmahaEvent(OmahaEvent::kTypeUpdateComplete),
+ fetcher); // Passes fetcher ownership
+ action.set_should_skip(true);
+ OmahaRequestActionTestProcessorDelegate delegate;
+ delegate.loop_ = loop;
+ ActionProcessor processor;
+ processor.set_delegate(&delegate);
+ processor.EnqueueAction(&action);
+
+ g_timeout_add(0, &StartProcessorInRunLoop, &processor);
+ g_main_loop_run(loop);
+ g_main_loop_unref(loop);
+ EXPECT_FALSE(processor.IsRunning());
+}
+
TEST(OmahaRequestActionTest, InvalidXmlTest) {
OmahaResponse response;
ASSERT_FALSE(
« no previous file with comments | « omaha_request_action.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698