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

Unified Diff: components/update_client/update_checker_unittest.cc

Issue 2847023002: Parse update check run actions for the component updater. (Closed)
Patch Set: Added missing data file dependency. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/update_client/request_sender_unittest.cc ('k') | components/update_client/update_response.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/update_checker_unittest.cc
diff --git a/components/update_client/update_checker_unittest.cc b/components/update_client/update_checker_unittest.cc
index ae1c625644649de5e5484d6e8c621656f2ef326e..6546206f1ba14c61e002f99ed980f5166fdc705b 100644
--- a/components/update_client/update_checker_unittest.cc
+++ b/components/update_client/update_checker_unittest.cc
@@ -205,7 +205,7 @@ TEST_F(UpdateCheckerTest, UpdateCheckSuccess) {
// Sanity check the request.
const auto request = post_interceptor_->GetRequests()[0];
EXPECT_NE(string::npos, post_interceptor_->GetRequests()[0].find(
- "request protocol=\"3.0\" extra=\"params\""));
+ "request protocol=\"3.1\" extra=\"params\""));
// The request must not contain any "dlpref" in the default case.
EXPECT_EQ(string::npos, request.find(" dlpref=\""));
EXPECT_NE(
@@ -233,6 +233,8 @@ TEST_F(UpdateCheckerTest, UpdateCheckSuccess) {
GURL("http://localhost/download/jebgalgnebhfojomionfpkfelancnnkf.crx"),
component->crx_urls_.front());
+ EXPECT_STREQ("this", component->action_run_.c_str());
+
#if (OS_WIN)
EXPECT_NE(string::npos, request.find(" domainjoined="));
#if defined(GOOGLE_CHROME_BUILD)
@@ -535,4 +537,31 @@ TEST_F(UpdateCheckerTest, UpdateCheckUpdateDisabled) {
"<updatecheck/>"));
}
+TEST_F(UpdateCheckerTest, NoUpdateActionRun) {
+ EXPECT_TRUE(post_interceptor_->ExpectRequest(
+ new PartialMatch("updatecheck"),
+ test_file("updatecheck_reply_noupdate.xml")));
+
+ update_checker_ = UpdateChecker::Create(config_, metadata_.get());
+
+ IdToComponentPtrMap components;
+ components[kUpdateItemId] = MakeComponent();
+
+ auto& component = components[kUpdateItemId];
+
+ update_checker_->CheckForUpdates(
+ std::vector<std::string>{kUpdateItemId}, components, "", true,
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
+ RunThreads();
+
+ EXPECT_EQ(1, post_interceptor_->GetHitCount())
+ << post_interceptor_->GetRequestsAsString();
+ ASSERT_EQ(1, post_interceptor_->GetCount())
+ << post_interceptor_->GetRequestsAsString();
+
+ EXPECT_EQ(0, error_);
+ EXPECT_STREQ("this", component->action_run_.c_str());
+}
+
} // namespace update_client
« no previous file with comments | « components/update_client/request_sender_unittest.cc ('k') | components/update_client/update_response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698