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

Unified Diff: extensions/browser/updater/update_service_browsertest.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 | « extensions/browser/updater/update_service.cc ('k') | extensions/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/updater/update_service_browsertest.cc
diff --git a/extensions/browser/updater/update_service_browsertest.cc b/extensions/browser/updater/update_service_browsertest.cc
index 78fe377cd5c2f6c3f88684bb2e66d584611bfe9b..c4ff0ef0cb56fe50262a9f5dc74628a54fb4a366 100644
--- a/extensions/browser/updater/update_service_browsertest.cc
+++ b/extensions/browser/updater/update_service_browsertest.cc
@@ -27,8 +27,9 @@ namespace {
using FakeResponse = std::pair<std::string, net::HttpStatusCode>;
// TODO(rockot): In general there's enough mock-Omaha-noise that this might be
-// better placed into some test library code in //components/omaha_client.
-FakeResponse CreateFakeOmahaResponse(const std::string& id, size_t crx_length) {
+// better placed into some test library code in //components/update_client.
+FakeResponse CreateFakeUpdateResponse(const std::string& id,
+ size_t crx_length) {
std::string response_text = base::StringPrintf(
"<gupdate xmlns=\"http://www.google.com/update2/response\" "
" protocol=\"2.0\" server=\"prod\">\n"
@@ -45,7 +46,7 @@ FakeResponse CreateFakeOmahaResponse(const std::string& id, size_t crx_length) {
return std::make_pair(response_text, net::HTTP_OK);
}
-FakeResponse CreateFakeOmahaNotFoundResponse() {
+FakeResponse CreateFakeUpdateNotFoundResponse() {
return std::make_pair(
std::string(
"<gupdate xmlns=\"http://www.google.com/update2/response\" "
@@ -76,7 +77,7 @@ bool ExtractKeyValueFromComponent(const std::string& component_str,
// This function extracts the 'x' query parameter (e.g. "id%3Dabcdef...."),
// unescapes its value (to become e.g., "id=abcdef...", and then extracts the
// 'id' value from the result (e.g. "abcdef...").
-bool ExtractIdFromOmahaQuery(const std::string& query_str, std::string* id) {
+bool ExtractIdFromUpdateQuery(const std::string& query_str, std::string* id) {
std::string data_string;
if (!ExtractKeyValueFromComponent(query_str, "x", &data_string))
return false;
@@ -99,7 +100,7 @@ class FakeUpdateURLFetcherFactory : public net::URLFetcherFactory {
void RegisterFakeExtension(const std::string& id,
const std::string& contents) {
- CHECK(id.size() == 32);
+ CHECK_EQ(32u, id.size());
fake_extensions_.insert(std::make_pair(id, contents));
}
@@ -128,14 +129,14 @@ class FakeUpdateURLFetcherFactory : public net::URLFetcherFactory {
// Otherwise return an invalid-ID response.
FakeResponse response;
std::string extension_id;
- if (!ExtractIdFromOmahaQuery(url.query(), &extension_id)) {
- response = CreateFakeOmahaNotFoundResponse();
+ if (!ExtractIdFromUpdateQuery(url.query(), &extension_id)) {
+ response = CreateFakeUpdateNotFoundResponse();
} else {
const auto& iter = fake_extensions_.find(extension_id);
if (iter == fake_extensions_.end())
- response = CreateFakeOmahaNotFoundResponse();
+ response = CreateFakeUpdateNotFoundResponse();
else
- response = CreateFakeOmahaResponse(extension_id, iter->second.size());
+ response = CreateFakeUpdateResponse(extension_id, iter->second.size());
}
return new net::FakeURLFetcher(url, delegate, response.first,
response.second,
« no previous file with comments | « extensions/browser/updater/update_service.cc ('k') | extensions/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698