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

Unified Diff: components/update_client/utils_unittest.cc

Issue 2340113002: Inject the prodid for the extensions and component updaters. (Closed)
Patch Set: Remove "chromium" as a possible value in comment. Created 4 years, 3 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
Index: components/update_client/utils_unittest.cc
diff --git a/components/update_client/utils_unittest.cc b/components/update_client/utils_unittest.cc
index 4609b7f656f61b7234347736695e585f859631fb..9370a879b0633cb4500e46735bfd5f251d0781da 100644
--- a/components/update_client/utils_unittest.cc
+++ b/components/update_client/utils_unittest.cc
@@ -23,17 +23,22 @@ base::FilePath MakeTestFilePath(const char* file) {
namespace update_client {
-TEST(UpdateClientUtils, BuildProtocolRequest_DownloadPreference) {
- const string emptystr;
+TEST(UpdateClientUtils, BuildProtocolRequest_ProdIdVersion) {
+ // Verifies that |prod_id| and |version| are serialized.
+ const string request =
+ BuildProtocolRequest("some_prod_id", "1.0", "", "", "", "", "", "");
+ EXPECT_NE(string::npos, request.find(" version=\"some_prod_id-1.0\" "));
+}
+TEST(UpdateClientUtils, BuildProtocolRequest_DownloadPreference) {
// Verifies that an empty |download_preference| is not serialized.
- const string request_no_dlpref = BuildProtocolRequest(
- emptystr, emptystr, emptystr, emptystr, emptystr, emptystr, emptystr);
+ const string request_no_dlpref =
+ BuildProtocolRequest("", "", "", "", "", "", "", "");
EXPECT_EQ(string::npos, request_no_dlpref.find(" dlpref="));
// Verifies that |download_preference| is serialized.
- const string request_with_dlpref = BuildProtocolRequest(
- emptystr, emptystr, emptystr, emptystr, "some pref", emptystr, emptystr);
+ const string request_with_dlpref =
+ BuildProtocolRequest("", "", "", "", "", "some pref", "", "");
EXPECT_NE(string::npos, request_with_dlpref.find(" dlpref=\"some pref\""));
}
« no previous file with comments | « components/update_client/utils.cc ('k') | ios/chrome/browser/component_updater/ios_component_updater_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698