Commit aff08690 authored by Mila Green's avatar Mila Green Committed by Chromium LUCI CQ

Updater: Brand the URL constants.

Bug: 1108975
Change-Id: I2ce60fb3a3b3f35f30dd122ab304a748d9246d1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612266
Commit-Queue: Mila Green <milagreen@chromium.org>
Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Reviewed-by: default avatarS. Ganesh <ganesh@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841210}
parent 442ec9d5
......@@ -64,6 +64,7 @@ if (is_win || is_mac) {
]
deps = [
":branding_header",
":version_header",
"//base",
"//components/crash/core/common:crash_key_lib",
......@@ -176,6 +177,7 @@ if (is_win || is_mac) {
deps = [
":base",
":branding_header",
":version_header",
"//base",
"//base:i18n",
......@@ -227,6 +229,11 @@ if (is_win || is_mac) {
process_version("version_header") {
sources = [ "//chrome/VERSION" ]
template_file = "updater_version.h.in"
output = "$target_gen_dir/updater_version.h"
}
process_version("branding_header") {
extra_args = [
"-e",
"COMPANY_FULLNAME=\"$updater_company_full_name\"",
......@@ -242,10 +249,18 @@ if (is_win || is_mac) {
"BROWSER_NAME=\"$browser_name\"",
"-e",
"MAC_BROWSER_BUNDLE_IDENTIFIER=\"$mac_browser_bundle_identifier\"",
"-e",
"UPDATE_CHECK_URL=\"$update_check_url\"",
"-e",
"CRASH_UPLOAD_URL=\"$crash_upload_url\"",
"-e",
"CRASH_STAGING_UPLOAD_URL=\"$crash_staging_upload_url\"",
"-e",
"DEVICE_MANAGEMENT_SERVER_URL=\"$device_management_server_url\"",
]
template_file = "updater_version.h.in"
output = "$target_gen_dir/updater_version.h"
template_file = "updater_branding.h.in"
output = "$target_gen_dir/updater_branding.h"
}
source_set("updater_tests_support") {
......@@ -275,7 +290,7 @@ if (is_win || is_mac) {
]
deps = [
":version_header",
":branding_header",
"//base",
"//components/update_client",
]
......@@ -324,6 +339,7 @@ if (is_win || is_mac) {
deps = [
":base",
":branding_header",
":lib",
":updater",
":updater_tests_support",
......@@ -393,7 +409,7 @@ if (is_win || is_mac) {
}
}
process_version("version_header_py") {
process_version("branding_header_py") {
process_only = true
sources = [ "//chrome/VERSION" ]
......@@ -415,6 +431,15 @@ if (is_win || is_mac) {
"MAC_BROWSER_BUNDLE_IDENTIFIER=\"$mac_browser_bundle_identifier\"",
]
template_file = "test/integration_tests/updater/branding_info.py.in"
output = "$target_gen_dir/branding_info.py"
}
process_version("version_header_py") {
process_only = true
sources = [ "//chrome/VERSION" ]
template_file = "test/integration_tests/updater/version_info.py.in"
output = "$target_gen_dir/version_info.py"
}
......@@ -436,21 +461,23 @@ if (is_win || is_mac) {
"//chrome/updater/run_updater_tests.py",
"//chrome/updater/test/",
"//third_party/catapult/third_party/typ/",
"$target_gen_dir/branding_info.py",
"$target_gen_dir/version_info.py",
]
data_deps = [
":branding_header_py",
":version_header_py",
]
if (is_win) {
data_deps = [
":version_header_py",
data_deps += [
"//chrome/updater/win:updater",
"//chrome/updater/win/installer",
]
}
if (is_mac) {
data_deps = [
":version_header_py",
"//chrome/updater/mac:updater_bundle",
]
data_deps += [ "//chrome/updater/mac:updater_bundle" ]
}
}
}
......@@ -8,7 +8,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
namespace updater {
namespace {
......
......@@ -25,7 +25,6 @@
#import "chrome/updater/mac/xpc_service_names.h"
#include "chrome/updater/update_service.h"
#include "chrome/updater/update_service_internal.h"
#include "chrome/updater/updater_version.h"
@interface CRUUpdateServiceXPCImpl : NSObject <CRUUpdateServicing>
......
......@@ -25,3 +25,9 @@ if (is_chrome_branded) {
mac_updater_bundle_identifier = "org.chromium.ChromiumUpdater"
mac_browser_bundle_identifier = "org.chromium.Chromium"
}
# Chrome and Chromium share the same endpoints for now.
update_check_url = "https://update.googleapis.com/service/update2/json"
crash_upload_url = "https://clients2.google.com/cr/report"
crash_staging_upload_url = "https://clients2.google.com/cr/staging_report"
device_management_server_url = "https://m.google.com/devicemanagement/data/api"
......@@ -4,7 +4,7 @@
#include "chrome/updater/constants.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
namespace updater {
......@@ -41,15 +41,6 @@ const char kServerUpdateServiceSwitchValue[] = "update";
const char kInstallFromOutDir[] = "install-from-out-dir";
#endif // OS_WIN
// TODO(crbug/1108975): brand the URLs below.
const char kUpdaterJSONDefaultUrl[] =
"https://update.googleapis.com/service/update2/json";
const char kCrashUploadURL[] = "https://clients2.google.com/cr/report";
const char kCrashStagingUploadURL[] =
"https://clients2.google.com/cr/staging_report";
const char kDeviceManagementServerURL[] =
"https://m.google.com/devicemanagement/data/api";
// Path names.
const char kAppsDir[] = "apps";
const char kUninstallScript[] = "uninstall.cmd";
......
......@@ -113,18 +113,6 @@ extern const char kAppIdSwitch[];
// Specifies the version of the application that the updater needs to register.
extern const char kAppVersionSwitch[];
// URLs.
//
// Omaha server end point.
extern const char kUpdaterJSONDefaultUrl[];
// The URL where crash reports are uploaded.
extern const char kCrashUploadURL[];
extern const char kCrashStagingUploadURL[];
// DM server end point.
extern const char kDeviceManagementServerURL[];
// File system paths.
//
// The directory name where CRX apps get installed. This is provided for demo
......
......@@ -18,7 +18,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/util.h"
#include "third_party/crashpad/crashpad/client/crashpad_client.h"
#include "third_party/crashpad/crashpad/handler/handler_main.h"
......@@ -77,7 +77,7 @@ void StartCrashReporter(const std::string& version) {
crashpad::CrashpadClient* client = GetCrashpadClient();
if (!client->StartHandler(handler_path, database_path,
/*metrics_dir=*/base::FilePath(),
kCrashStagingUploadURL, annotations, arguments,
CRASH_STAGING_UPLOAD_URL, annotations, arguments,
/*restartable=*/true,
/*asynchronous_start=*/false)) {
LOG(DFATAL) << "Failed to start handler.";
......
......@@ -25,6 +25,7 @@ source_set("device_management") {
deps = [
"//base",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater:version_header",
"//chrome/updater/protos:omaha_proto",
"//components/update_client",
......
......@@ -14,6 +14,7 @@
#include "chrome/updater/constants.h"
#include "chrome/updater/device_management/dm_cached_policy_info.h"
#include "chrome/updater/device_management/dm_storage.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/util.h"
#include "components/policy/core/common/cloud/cloud_policy_util.h"
......@@ -61,7 +62,7 @@ class DefaultConfigurator : public DMClient::Configurator {
~DefaultConfigurator() override = default;
std::string GetDMServerUrl() const override {
return kDeviceManagementServerURL;
return DEVICE_MANAGEMENT_SERVER_URL;
}
std::string GetAgentParameter() const override {
......
......@@ -15,7 +15,6 @@
#include "base/strings/sys_string_conversions.h"
#include "chrome/updater/device_management/dm_cached_policy_info.h"
#include "chrome/updater/device_management/dm_policy_manager.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/util.h"
#include "components/policy/proto/device_management_backend.pb.h"
......
......@@ -18,7 +18,7 @@
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
namespace updater {
......
......@@ -6,6 +6,7 @@
#include "chrome/updater/external_constants_impl.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/updater_branding.h"
#include "url/gurl.h"
namespace updater {
......@@ -19,7 +20,7 @@ class DefaultExternalConstants : public ExternalConstants {
// Overrides of ExternalConstants:
std::vector<GURL> UpdateURL() const override {
return std::vector<GURL>{GURL(kUpdaterJSONDefaultUrl)};
return std::vector<GURL>{GURL(UPDATE_CHECK_URL)};
}
bool UseCUP() const override { return true; }
......
......@@ -10,7 +10,6 @@
#include "base/strings/sys_string_conversions.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/external_constants_impl.h"
#include "chrome/updater/updater_version.h"
#include "url/gurl.h"
#include "base/logging.h"
......
......@@ -10,7 +10,6 @@
#include "base/mac/scoped_nsobject.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/external_constants.h"
#include "chrome/updater/updater_version.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
......
......@@ -8,6 +8,7 @@
#include "chrome/updater/constants.h"
#include "chrome/updater/external_constants.h"
#include "chrome/updater/updater_branding.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
......@@ -18,7 +19,7 @@ TEST_F(DevOverrideTest, TestDefaults) {
EXPECT_TRUE(consts->UseCUP());
std::vector<GURL> urls = consts->UpdateURL();
ASSERT_EQ(urls.size(), 1ul);
EXPECT_EQ(urls[0], GURL(kUpdaterJSONDefaultUrl));
EXPECT_EQ(urls[0], GURL(UPDATE_CHECK_URL));
EXPECT_TRUE(urls[0].is_valid());
}
......
......@@ -74,6 +74,7 @@ source_set("xpc_names") {
deps = [
"//base",
"//chrome/updater:branding_header",
"//chrome/updater:version_header",
]
......@@ -89,6 +90,7 @@ source_set("util") {
deps = [
"//base",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater:version_header",
]
......@@ -108,6 +110,7 @@ source_set("updater_setup_sources") {
"//base",
"//chrome/common/mac:launchd",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater:version_header",
"//components/crash/core/common:crash_key_lib",
"//mojo/public/cpp/platform",
......
......@@ -29,7 +29,7 @@
#include "chrome/updater/crash_reporter.h"
#import "chrome/updater/mac/util.h"
#import "chrome/updater/mac/xpc_service_names.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/util.h"
#include "components/crash/core/common/crash_key.h"
......
......@@ -23,7 +23,6 @@
#import "chrome/updater/mac/xpc_service_names.h"
#include "chrome/updater/service_scope.h"
#include "chrome/updater/update_service.h"
#include "chrome/updater/updater_version.h"
#include "components/update_client/update_client_errors.h"
using base::SysUTF8ToNSString;
......
......@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/version.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/util.h"
......
......@@ -8,6 +8,7 @@
#include "base/mac/foundation_util.h"
#include "base/strings/strcat.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_version.h"
namespace updater {
......
......@@ -11,7 +11,6 @@
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "chrome/updater/prefs_impl.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/util.h"
#include "components/prefs/json_pref_store.h"
#include "components/prefs/pref_registry_simple.h"
......
......@@ -12,7 +12,7 @@
#include "base/mac/scoped_mach_port.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
namespace {
......
......@@ -57,6 +57,20 @@ def main():
logging.info('File not found: %s' % version_file_path)
return -1
# copy dynamically generated updater branding_info.py from
# target gen directory to
# //chrome/updater/test/integration_tests/updater so that
# it can be imported as a module during test runs.
branding_file_path = os.path.join(target_gen_dir_abs_path, 'gen',
'chrome', 'updater', 'branding_info.py')
if os.path.exists(branding_file_path):
dest = os.path.join(path_finder.get_integration_tests_dir(),
'updater', 'branding_info.py')
copy_file(branding_file_path, dest)
else:
logging.info('File not found: %s' % branding_file_path)
return -2
runner.context = Context(runner.args.build_dir)
return runner.run()[0]
......
# Copyright 2021 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.
# Branding Information
COMPANY_FULLNAME_STRING = "@COMPANY_FULLNAME@"
COMPANY_SHORTNAME_STRING = "@COMPANY_SHORTNAME@"
PRODUCT_FULLNAME_STRING = "@PRODUCT_FULLNAME@"
OFFICIAL_BUILD_STRING = "@OFFICIAL_BUILD@"
MAC_BUNDLE_IDENTIFIER_STRING = "@MAC_BUNDLE_IDENTIFIER@"
BROWSER_NAME_STRING = "@BROWSER_NAME@"
MAC_BROWSER_BUNDLE_IDENTIFIER_STRING = "@MAC_BROWSER_BUNDLE_IDENTIFIER@"
# Copyright 2021 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.
"""Tests generated updater branding details."""
import typ
from test.integration_tests.updater import branding_info
class UpdaterBrandingInfoTest(typ.TestCase):
def test_company_info(self):
(self.assertIsNotNone(branding_info.COMPANY_FULLNAME_STRING)
and self.assertIsNotNone(branding_info.COMPANY_SHORTNAME_STRING))
def test_product_info(self):
self.assertIsNotNone(branding_info.PRODUCT_FULLNAME_STRING)
def test_official_build_str(self):
self.assertIsNotNone(branding_info.OFFICIAL_BUILD_STRING)
def test_browser_name_str(self):
self.assertIsNotNone(branding_info.BROWSER_NAME_STRING)
......@@ -12,16 +12,3 @@ class UpdaterVersionInfoTest(typ.TestCase):
def test_get_updater_version(self):
self.assertIsNotNone(version_info.UPDATER_VERSION_STRING)
def test_company_info(self):
(self.assertIsNotNone(version_info.COMPANY_FULLNAME_STRING)
and self.assertIsNotNone(version_info.COMPANY_SHORTNAME_STRING))
def test_product_info(self):
self.assertIsNotNone(version_info.PRODUCT_FULLNAME_STRING)
def test_official_build_str(self):
self.assertIsNotNone(version_info.OFFICIAL_BUILD_STRING)
def test_browser_name_str(self):
self.assertIsNotNone(version_info.BROWSER_NAME_STRING)
......@@ -6,12 +6,3 @@
UPDATER_VERSION = (@MAJOR@,@MINOR@,@BUILD@,@PATCH@)
UPDATER_VERSION_STRING = "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
# Branding Information
COMPANY_FULLNAME_STRING = "@COMPANY_FULLNAME@"
COMPANY_SHORTNAME_STRING = "@COMPANY_SHORTNAME@"
PRODUCT_FULLNAME_STRING = "@PRODUCT_FULLNAME@"
OFFICIAL_BUILD_STRING = "@OFFICIAL_BUILD@"
MAC_BUNDLE_IDENTIFIER_STRING = "@MAC_BUNDLE_IDENTIFIER@"
BROWSER_NAME_STRING = "@BROWSER_NAME@"
MAC_BROWSER_BUNDLE_IDENTIFIER_STRING = "@MAC_BROWSER_BUNDLE_IDENTIFIER@"
......@@ -23,7 +23,7 @@
#include "chrome/updater/test/integration_tests.h"
#include "chrome/updater/test/test_app/constants.h"
#include "chrome/updater/test/test_app/test_app_version.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
......
......@@ -22,6 +22,7 @@
#include "chrome/updater/app/server/win/updater_legacy_idl.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/test/integration_tests.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/util.h"
#include "chrome/updater/win/constants.h"
......
// Copyright 2021 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.
// Branding Information
#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
#define MAC_BUNDLE_IDENTIFIER_STRING "@MAC_BUNDLE_IDENTIFIER@"
#define BROWSER_NAME_STRING "@BROWSER_NAME@"
#define MAC_BROWSER_BUNDLE_IDENTIFIER_STRING "@MAC_BROWSER_BUNDLE_IDENTIFIER@"
#define UPDATE_CHECK_URL "@UPDATE_CHECK_URL@"
#define CRASH_UPLOAD_URL "@CRASH_UPLOAD_URL@"
#define CRASH_STAGING_UPLOAD_URL "@CRASH_STAGING_UPLOAD_URL@"
#define DEVICE_MANAGEMENT_SERVER_URL "@DEVICE_MANAGEMENT_SERVER_URL@"
......@@ -9,7 +9,7 @@
#include "base/process/process.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_WIN)
......
......@@ -6,12 +6,3 @@
#define UPDATER_VERSION @MAJOR@,@MINOR@,@BUILD@,@PATCH@
#define UPDATER_VERSION_STRING "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
// Branding Information
#define COMPANY_FULLNAME_STRING "@COMPANY_FULLNAME@"
#define COMPANY_SHORTNAME_STRING "@COMPANY_SHORTNAME@"
#define PRODUCT_FULLNAME_STRING "@PRODUCT_FULLNAME@"
#define OFFICIAL_BUILD_STRING "@OFFICIAL_BUILD@"
#define MAC_BUNDLE_IDENTIFIER_STRING "@MAC_BUNDLE_IDENTIFIER@"
#define BROWSER_NAME_STRING "@BROWSER_NAME@"
#define MAC_BROWSER_BUNDLE_IDENTIFIER_STRING "@MAC_BROWSER_BUNDLE_IDENTIFIER@"
......@@ -10,6 +10,7 @@
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_version.h"
#include "url/gurl.h"
......
......@@ -69,7 +69,7 @@ source_set("constants") {
deps = [
"//base",
"//chrome/updater:version_header",
"//chrome/updater:branding_header",
]
}
......@@ -128,6 +128,7 @@ source_set("lib") {
"//base",
"//chrome/installer/util:with_no_strings",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater:version_header",
"//chrome/updater/app/server/win:updater_idl_idl",
"//chrome/updater/app/server/win:updater_internal_idl_idl",
......@@ -243,7 +244,7 @@ test("updater_unittests") {
":lib",
"//base",
"//base/test:test_support",
"//chrome/updater:version_header",
"//chrome/updater:branding_header",
"//chrome/updater/win/test:test_executables",
"//chrome/updater/win/test:test_strings",
"//testing/gtest",
......
......@@ -8,7 +8,7 @@
#include <windows.h>
#include "base/strings/string16.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
namespace updater {
......
......@@ -31,6 +31,8 @@
#include "chrome/updater/app/server/win/updater_internal_idl.h"
#include "chrome/updater/app/server/win/updater_legacy_idl.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/util.h"
#include "chrome/updater/win/constants.h"
#include "chrome/updater/win/setup/setup_util.h"
......
......@@ -27,7 +27,7 @@
#include "base/win/scoped_handle.h"
#include "base/win/scoped_variant.h"
#include "base/win/windows_version.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/win/util.h"
namespace updater {
......
......@@ -22,7 +22,7 @@
#include "base/win/scoped_bstr.h"
#include "base/win/scoped_variant.h"
#include "base/win/windows_version.h"
#include "chrome/updater/updater_version.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/win/test/test_executables.h"
#include "chrome/updater/win/test/test_strings.h"
#include "chrome/updater/win/util.h"
......
......@@ -40,6 +40,7 @@ source_set("ui") {
"//base",
"//base:i18n",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater/win:install_progress_observer",
"//chrome/updater/win:lib",
"//third_party/wtl",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment