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

Unified Diff: components/update_client/update_checker_unittest.cc

Issue 1606943007: Implement Windows GPO support for "dlpref" in component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whitespace comments only Created 4 years, 11 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/update_checker.cc ('k') | components/update_client/utils.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 df0bd7a5e471a261b87f1b25a903f487b5a8ae25..727c0d01e20cbb60da1c13715c34e6f55ecbabf1 100644
--- a/components/update_client/update_checker_unittest.cc
+++ b/components/update_client/update_checker_unittest.cc
@@ -187,6 +187,9 @@ TEST_F(UpdateCheckerTest, UpdateCheckSuccess) {
// Sanity check the request.
EXPECT_NE(string::npos, post_interceptor_->GetRequests()[0].find(
"request protocol=\"3.0\" extra=\"params\""));
+ // The request must not contain any "dlpref" in the default case.
+ EXPECT_EQ(string::npos,
+ post_interceptor_->GetRequests()[0].find(" dlpref=\""));
EXPECT_NE(
string::npos,
post_interceptor_->GetRequests()[0].find(
@@ -236,4 +239,28 @@ TEST_F(UpdateCheckerTest, UpdateCheckError) {
EXPECT_EQ(0ul, results_.list.size());
}
+TEST_F(UpdateCheckerTest, UpdateCheckDownloadPreference) {
+ EXPECT_TRUE(post_interceptor_->ExpectRequest(
+ new PartialMatch("updatecheck"), test_file("updatecheck_reply_1.xml")));
+
+ config_->SetDownloadPreference(string("cacheable"));
+
+ update_checker_ = UpdateChecker::Create(config_);
+
+ CrxUpdateItem item(BuildCrxUpdateItem());
+ std::vector<CrxUpdateItem*> items_to_check;
+ items_to_check.push_back(&item);
+
+ update_checker_->CheckForUpdates(
+ items_to_check, "extra=\"params\"",
+ base::Bind(&UpdateCheckerTest::UpdateCheckComplete,
+ base::Unretained(this)));
+
+ RunThreads();
+
+ // The request must contain dlpref="cacheable".
+ EXPECT_NE(string::npos,
+ post_interceptor_->GetRequests()[0].find(" dlpref=\"cacheable\""));
+}
+
} // namespace update_client
« no previous file with comments | « components/update_client/update_checker.cc ('k') | components/update_client/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698