Skip to content

Commit

Permalink
Enable the MSI integration tests for Chromium builds
Browse files Browse the repository at this point in the history
The WiX toolset is not available for Chromium Windows builds. This CL
makes build changes to allow for generated Chromium MSIs in the absence
of WiX, and enables the MSI integration tests for Chromium builds.

Fixed: 1472846
Change-Id: Ie0d1ed30276a83169c71f5ba43ccb94ff7b589f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4814746
Commit-Queue: S Ganesh <ganesh@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Auto-Submit: S Ganesh <ganesh@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1188713}
  • Loading branch information
GitHubGanesh authored and Chromium LUCI CQ committed Aug 26, 2023
1 parent 5177161 commit 684e733
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 41 deletions.
10 changes: 2 additions & 8 deletions chrome/updater/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -860,20 +860,14 @@ if (is_win || is_mac || is_linux) {
":updater_selfupdate_test_crx",
"//chrome/updater/test/test_installer:test_app2_installer",
"//chrome/updater/test/test_installer:test_app2_installer_crx",
"//chrome/updater/test/test_installer:test_msi_installer1.0.0.0",
"//chrome/updater/test/test_installer:test_msi_installer_crx",
"//chrome/updater/win:updater",
"//chrome/updater/win:updater_test",
"//chrome/updater/win/installer:installer_test",
"//chrome/updater/win/test:updater_test_process",
]

# TODO(crbug.com/1472846): WiX tools are only available on `src-internal`.
if (is_chrome_branded) {
data_deps += [
"//chrome/updater/test/test_installer:test_msi_installer1.0.0.0",
"//chrome/updater/test/test_installer:test_msi_installer_crx",
]
}

data += [
"test/data/ProcmonConfiguration.pmc",
"//chrome/test/data/updater/OfflineManifest.gup",
Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions chrome/updater/test/integration_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1884,8 +1884,6 @@ TEST_F(IntegrationTestDeviceManagement, RollbackToTargetVersion) {
ASSERT_NO_FATAL_FAILURE(Uninstall());
}

// TODO(crbug.com/1472846): WiX tools are only available on `src-internal`.
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
TEST_F(IntegrationTestDeviceManagement, MsiInstallUpgrade) {
constexpr char kMsiAppId[] = "{c28fcf72-bcf2-45c5-8def-31a74ac02012}";
constexpr char kMsiCrx[] = "TestSystemMsiInstaller.msi.crx3";
Expand Down Expand Up @@ -1946,7 +1944,6 @@ TEST_F(IntegrationTestDeviceManagement, MsiInstallUpgrade) {
ASSERT_NO_FATAL_FAILURE(RemoveMsiProductData(kMsiProductIdInitialVersion));
ASSERT_NO_FATAL_FAILURE(RemoveMsiProductData(kMsiProductIdUpdatedVersion));
}
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // !defined(COMPONENT_BUILD)
#endif // BUILDFLAG(IS_WIN)
#endif // BUILDFLAG(IS_WIN) || !defined(COMPONENT_BUILD)
Expand Down
66 changes: 36 additions & 30 deletions chrome/updater/test/test_installer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,23 @@ crx3("test_app2_installer_crx") {
deps = [ ":test_app2_installer" ]
}

# TODO(crbug.com/1472846): WiX tools are only available on `src-internal`.
if (is_chrome_branded) {
template("test_msi_installer") {
template("test_msi_installer") {
testonly = true
appid = "{c28fcf72-bcf2-45c5-8def-31a74ac02012}"
msi_base_name = "TestSystemMsiInstaller"
version = invoker.version
relative_path = appid + "." + version + "/" + msi_base_name + ".msi"
output_installer = "$root_build_dir/test_installer/" + relative_path

if (is_chrome_branded) {
action("test_msi_installer" + target_name) {
testonly = true
script = "create_test_msi_installer.py"
test_installer_wxs_xml = "test_installer.wxs.xml"
appid = "{c28fcf72-bcf2-45c5-8def-31a74ac02012}"
version = invoker.version
msi_base_name = "TestSystemMsiInstaller"

inputs = [
script,
test_installer_wxs_xml,
]

output_installer = "$root_build_dir/test_installer/" + appid + "." +
version + "/" + msi_base_name + ".msi"
outputs = [ output_installer ]

args = [
Expand All @@ -145,29 +144,36 @@ if (is_chrome_branded) {
rebase_path("$root_build_dir/test_installer"),
]
}
} else {
# WiX tools are only available on `src-internal`, so the Chromium version is
# generated and checked into `//chrome/updater/test/data/chromium_msi/`.
copy("test_msi_installer" + target_name) {
sources = [ "//chrome/updater/test/data/chromium_msi/" + relative_path ]
outputs = [ output_installer ]
}
}
}

test_msi_installer("1.0.0.0") {
version = "1.0.0.0"
}
test_msi_installer("1.0.0.0") {
version = "1.0.0.0"
}

test_msi_installer("2.0.0.0") {
version = "2.0.0.0"
}
test_msi_installer("2.0.0.0") {
version = "2.0.0.0"
}

copy("copy_test_msi_installer2.0.0.0") {
testonly = true
sources = get_target_outputs(":test_msi_installer2.0.0.0")
deps = [ ":test_msi_installer2.0.0.0" ]
outputs = [ "$root_build_dir/test_installer/{{source_file_part}}" ]
}
copy("copy_test_msi_installer2.0.0.0") {
testonly = true
sources = get_target_outputs(":test_msi_installer2.0.0.0")
deps = [ ":test_msi_installer2.0.0.0" ]
outputs = [ "$root_build_dir/test_installer/{{source_file_part}}" ]
}

crx3("test_msi_installer_crx") {
testonly = true
base_dir = "$root_build_dir/test_installer"
key = "//chrome/updater/test/data/selfupdate_test_key.der"
inputs = get_target_outputs(":copy_test_msi_installer2.0.0.0")
output = "$root_build_dir/test_installer/TestSystemMsiInstaller.msi.crx3"
deps = [ ":copy_test_msi_installer2.0.0.0" ]
}
crx3("test_msi_installer_crx") {
testonly = true
base_dir = "$root_build_dir/test_installer"
key = "//chrome/updater/test/data/selfupdate_test_key.der"
inputs = get_target_outputs(":copy_test_msi_installer2.0.0.0")
output = "$root_build_dir/test_installer/TestSystemMsiInstaller.msi.crx3"
deps = [ ":copy_test_msi_installer2.0.0.0" ]
}

0 comments on commit 684e733

Please sign in to comment.