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

Unified Diff: chrome/browser/update_client/chrome_update_query_params_delegate_unittest.cc

Issue 803313003: Rename omaha_client and similar tokens to update_client in all contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: rebase to master Created 5 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 | « chrome/browser/update_client/chrome_update_query_params_delegate.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/update_client/chrome_update_query_params_delegate_unittest.cc
diff --git a/chrome/browser/update_client/chrome_update_query_params_delegate_unittest.cc b/chrome/browser/update_client/chrome_update_query_params_delegate_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..76026d300e9bfe99b8bc23becc82d3331ce60c3a
--- /dev/null
+++ b/chrome/browser/update_client/chrome_update_query_params_delegate_unittest.cc
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "base/strings/stringprintf.h"
+#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
+#include "chrome/common/chrome_version_info.h"
+#include "components/update_client/update_query_params.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using base::StringPrintf;
+
+namespace {
+
+bool Contains(const std::string& source, const std::string& target) {
+ return source.find(target) != std::string::npos;
+}
+
+} // namespace
+
+void TestParams(update_client::UpdateQueryParams::ProdId prod_id) {
+ std::string params = update_client::UpdateQueryParams::Get(prod_id);
+
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("os=%s", update_client::UpdateQueryParams::GetOS())));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("arch=%s", update_client::UpdateQueryParams::GetArch())));
+ EXPECT_TRUE(Contains(
+ params, StringPrintf(
+ "prod=%s",
+ update_client::UpdateQueryParams::GetProdIdString(prod_id))));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("prodchannel=%s",
+ ChromeUpdateQueryParamsDelegate::GetChannelString())));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("prodversion=%s", chrome::VersionInfo().Version().c_str())));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("lang=%s", ChromeUpdateQueryParamsDelegate::GetLang())));
+}
+
+TEST(ChromeUpdateQueryParamsDelegateTest, GetParams) {
+ TestParams(update_client::UpdateQueryParams::CRX);
+ TestParams(update_client::UpdateQueryParams::CHROME);
+}
« no previous file with comments | « chrome/browser/update_client/chrome_update_query_params_delegate.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698