Commit 8b090304 authored by grt's avatar grt Committed by Commit bot

Remove multi-install from install_static.

BUG=577816

Review-Url: https://codereview.chromium.org/2601443002
Cr-Commit-Position: refs/heads/master@{#442874}
parent cdf61249
......@@ -31,7 +31,7 @@ const InstallConstants kInstallModes[] = {
L"", // Empty default channel name as above.
ChannelStrategy::UNSUPPORTED,
true, // Supports system-level installs.
true, // Supports multi-install.
true, // Supported multi-install.
},
};
......
......@@ -31,7 +31,7 @@ const InstallConstants kInstallModes[] = {
L"", // The empty string means "stable".
ChannelStrategy::ADDITIONAL_PARAMETERS,
true, // Supports system-level installs.
true, // Supports multi-install.
true, // Supported multi-install.
},
{
sizeof(kInstallModes[0]),
......@@ -41,7 +41,7 @@ const InstallConstants kInstallModes[] = {
L"canary",
ChannelStrategy::FIXED,
false, // Does not support system-level installs.
false, // Does not support multi-install.
false, // Did not support multi-install.
},
};
......
......@@ -58,8 +58,8 @@ struct InstallConstants {
// True if this mode supports system-level installs.
bool supports_system_level;
// True if this mode supports multi-install.
bool supports_multi_install;
// True if this mode supported the now-deprecated multi-install.
bool supported_multi_install;
};
} // namespace install_static
......
......@@ -26,16 +26,12 @@ InstallDetails* g_module_details = nullptr;
} // namespace
std::wstring InstallDetails::GetClientStateKeyPath(bool binaries) const {
return binaries && multi_install()
? GetBinariesClientStateKeyPath()
: install_static::GetClientStateKeyPath(app_guid());
std::wstring InstallDetails::GetClientStateKeyPath() const {
return install_static::GetClientStateKeyPath(app_guid());
}
std::wstring InstallDetails::GetClientStateMediumKeyPath(bool binaries) const {
return binaries && multi_install()
? GetBinariesClientStateMediumKeyPath()
: install_static::GetClientStateMediumKeyPath(app_guid());
std::wstring InstallDetails::GetClientStateMediumKeyPath() const {
return install_static::GetClientStateMediumKeyPath(app_guid());
}
bool InstallDetails::VersionMismatch() const {
......
......@@ -50,9 +50,6 @@ class InstallDetails {
// True if installed in C:\Program Files{, {x86)}; otherwise, false.
bool system_level;
// True if multi-install.
bool multi_install;
};
InstallDetails(const InstallDetails&) = delete;
......@@ -91,9 +88,9 @@ class InstallDetails {
return payload_->mode->supports_system_level;
}
// True if the mode supports multi-install.
bool supports_multi_install() const {
return payload_->mode->supports_multi_install;
// True if the mode once supported multi-install.
bool supported_multi_install() const {
return payload_->mode->supported_multi_install;
}
// The install's update channel, or an empty string if the brand does not
......@@ -102,21 +99,16 @@ class InstallDetails {
return std::wstring(payload_->channel, payload_->channel_length);
}
bool system_level() const { return payload_->system_level; }
bool multi_install() const { return payload_->multi_install; }
// Returns the path to the installation's ClientState registry key. Returns
// the path for the binaries if |binaries| and Chrome is
// multi-install. Otherwise, returns the path for Chrome itself. This registry
// key is used to hold various installation-related values, including an
// indication of consent for usage stats.
std::wstring GetClientStateKeyPath(bool binaries) const;
// Returns the path to the installation's ClientStateMedium registry key.
// Returns the path for the binaries if |binaries| and Chrome is
// multi-install. Otherwise, returns the path for Chrome itself. This
// Returns the path to the installation's ClientState registry key. This
// registry key is used to hold various installation-related values, including
// an indication of consent for usage stats.
std::wstring GetClientStateKeyPath() const;
// Returns the path to the installation's ClientStateMedium registry key. This
// registry key is used to hold various installation-related values, including
// an indication of consent for usage stats for a system-level install.
std::wstring GetClientStateMediumKeyPath(bool binaries) const;
std::wstring GetClientStateMediumKeyPath() const;
// Returns true if there is an indication of a mismatch between the primary
// module and this module.
......@@ -168,9 +160,6 @@ class PrimaryInstallDetails : public InstallDetails {
void set_system_level(bool system_level) {
payload_.system_level = system_level;
}
void set_multi_install(bool multi_install) {
payload_.multi_install = multi_install;
}
private:
std::wstring channel_;
......
......@@ -22,7 +22,7 @@ class FakeInstallDetails : public InstallDetails {
constants.size = sizeof(constants);
constants.install_suffix = L"";
constants.default_channel_name = L"";
constants.supports_multi_install = true;
constants.supported_multi_install = true;
if (kUseGoogleUpdateIntegration) {
constants.app_guid = L"testguid";
constants.channel_strategy = ChannelStrategy::FIXED;
......@@ -57,68 +57,23 @@ class FakeInstallDetails : public InstallDetails {
TEST(InstallDetailsTest, GetClientStateKeyPath) {
FakeInstallDetails details;
if (kUseGoogleUpdateIntegration) {
// Single-install.
EXPECT_THAT(details.GetClientStateKeyPath(false),
EXPECT_THAT(details.GetClientStateKeyPath(),
StrEq(L"Software\\Google\\Update\\ClientState\\testguid"));
EXPECT_THAT(details.GetClientStateKeyPath(true),
StrEq(L"Software\\Google\\Update\\ClientState\\testguid"));
// Multi-install.
details.payload.multi_install = true;
EXPECT_THAT(details.GetClientStateKeyPath(false),
StrEq(L"Software\\Google\\Update\\ClientState\\testguid"));
EXPECT_THAT(details.GetClientStateKeyPath(true),
StrEq(std::wstring(L"Software\\Google\\Update\\ClientState\\")
.append(kBinariesAppGuid)));
} else {
// Single-install.
EXPECT_THAT(details.GetClientStateKeyPath(false),
StrEq(std::wstring(L"Software\\").append(kProductPathName)));
EXPECT_THAT(details.GetClientStateKeyPath(true),
EXPECT_THAT(details.GetClientStateKeyPath(),
StrEq(std::wstring(L"Software\\").append(kProductPathName)));
// Multi-install.
details.payload.multi_install = true;
EXPECT_THAT(details.GetClientStateKeyPath(false),
StrEq(std::wstring(L"Software\\").append(kProductPathName)));
EXPECT_THAT(details.GetClientStateKeyPath(true),
StrEq(std::wstring(L"Software\\").append(kBinariesPathName)));
}
}
TEST(InstallDetailsTest, GetClientStateMediumKeyPath) {
FakeInstallDetails details;
if (kUseGoogleUpdateIntegration) {
// Single-install.
EXPECT_THAT(
details.GetClientStateMediumKeyPath(false),
StrEq(L"Software\\Google\\Update\\ClientStateMedium\\testguid"));
EXPECT_THAT(
details.GetClientStateMediumKeyPath(true),
details.GetClientStateMediumKeyPath(),
StrEq(L"Software\\Google\\Update\\ClientStateMedium\\testguid"));
// Multi-install.
details.payload.multi_install = true;
EXPECT_THAT(
details.GetClientStateMediumKeyPath(false),
StrEq(L"Software\\Google\\Update\\ClientStateMedium\\testguid"));
EXPECT_THAT(
details.GetClientStateMediumKeyPath(true),
StrEq(std::wstring(L"Software\\Google\\Update\\ClientStateMedium\\")
.append(kBinariesAppGuid)));
} else {
// Single-install.
EXPECT_THAT(details.GetClientStateKeyPath(false),
StrEq(std::wstring(L"Software\\").append(kProductPathName)));
EXPECT_THAT(details.GetClientStateKeyPath(true),
StrEq(std::wstring(L"Software\\").append(kProductPathName)));
// Multi-install.
details.payload.multi_install = true;
EXPECT_THAT(details.GetClientStateKeyPath(false),
EXPECT_THAT(details.GetClientStateKeyPath(),
StrEq(std::wstring(L"Software\\").append(kProductPathName)));
EXPECT_THAT(details.GetClientStateKeyPath(true),
StrEq(std::wstring(L"Software\\").append(kBinariesPathName)));
}
}
......
......@@ -52,14 +52,14 @@ extern const wchar_t kProductPathName[];
// The length, in characters, of kProductPathName not including the terminator.
extern const size_t kProductPathNameLength;
// The GUID with which the brand's multi-install binaries are registered with
// Google Update. Must be empty if the brand does not integrate with Google
// Update.
// The GUID with which the brand's multi-install binaries were registered with
// Google Update for modes that once supported the now-deprecated multi-install.
// Must be empty if the brand does not integrate with Google Update.
extern const wchar_t kBinariesAppGuid[];
// The name of the registry key in which data for the brand's multi-install
// binaries are stored. Must be empty if the brand integrates with Google
// Update.
// binaries were stored for modes that once supported the now-deprecated
// multi-install. Must be empty if the brand integrates with Google Update.
extern const wchar_t kBinariesPathName[];
// A brand's collection of install modes.
......
......@@ -45,11 +45,11 @@ TEST(InstallModes, VerifyModes) {
TEST(InstallModes, VerifyBrand) {
if (kUseGoogleUpdateIntegration) {
// Binaries are registered under an app guid with Google Update integration.
// Binaries were registered via an app guid with Google Update integration.
ASSERT_THAT(kBinariesAppGuid, StrNe(L""));
ASSERT_THAT(kBinariesPathName, StrEq(L""));
} else {
// Binaries are registered under a different path name without.
// Binaries were registered via a different path name without.
ASSERT_THAT(kBinariesAppGuid, StrEq(L""));
ASSERT_THAT(kBinariesPathName, StrNe(L""));
}
......
......@@ -257,21 +257,17 @@ std::vector<StringType> TokenizeStringT(
}
std::wstring ChannelFromAdditionalParameters(const InstallConstants& mode,
bool system_level,
bool binaries) {
bool system_level) {
assert(kUseGoogleUpdateIntegration);
// InitChannelInfo in google_update_settings.cc only reports a failure in the
// case of multi-install Chrome where the binaries' ClientState key exists,
// but that the "ap" value therein cannot be read due to some reason *other*
// than it not being present. This should be exceedingly rare. For
// simplicity's sake, use an empty |value| in case of any error whatsoever
// here.
// InitChannelInfo in google_update_settings.cc only reports a failure when
// Chrome's ClientState key exists but that the "ap" value therein cannot be
// read due to some reason *other* than it not being present. This should be
// exceedingly rare. For simplicity's sake, use an empty |value| in case of
// any error whatsoever here.
std::wstring value;
nt::QueryRegValueSZ(system_level ? nt::HKLM : nt::HKCU, nt::WOW6432,
(binaries ? GetBinariesClientStateKeyPath()
: GetClientStateKeyPath(mode.app_guid))
.c_str(),
kRegValueAp, &value);
GetClientStateKeyPath(mode.app_guid).c_str(), kRegValueAp,
&value);
static constexpr wchar_t kChromeChannelBetaPattern[] = L"1?1-*";
static constexpr wchar_t kChromeChannelBetaX64Pattern[] = L"*x64-beta*";
......@@ -294,7 +290,7 @@ std::wstring ChannelFromAdditionalParameters(const InstallConstants& mode,
}
// Else report values with garbage as stable since they will match the stable
// rules in the update configs. ChannelInfo::GetChannelName painstakingly
// strips off known modifiers (e.g., "-multi-full") to see if the empty string
// strips off known modifiers (e.g., "-full") to see if the empty string
// remains, returning channel "unknown" if not. This differs here in that some
// clients will tag crashes as "stable" rather than "unknown" via this
// codepath, but it is an accurate reflection of which update channel the
......@@ -309,10 +305,6 @@ bool IsSystemInstall() {
return InstallDetails::Get().system_level();
}
bool IsMultiInstall() {
return InstallDetails::Get().multi_install();
}
bool GetCollectStatsConsent() {
bool enabled = true;
......@@ -327,7 +319,7 @@ bool GetCollectStatsConsent() {
if (system_install &&
nt::QueryRegValueDWORD(
nt::HKLM, nt::WOW6432,
InstallDetails::Get().GetClientStateMediumKeyPath(true).c_str(),
InstallDetails::Get().GetClientStateMediumKeyPath().c_str(),
kRegValueUsageStats, &out_value)) {
return (out_value == 1);
}
......@@ -335,7 +327,7 @@ bool GetCollectStatsConsent() {
// Second, try ClientState.
return (nt::QueryRegValueDWORD(
system_install ? nt::HKLM : nt::HKCU, nt::WOW6432,
InstallDetails::Get().GetClientStateKeyPath(true).c_str(),
InstallDetails::Get().GetClientStateKeyPath().c_str(),
kRegValueUsageStats, &out_value) &&
out_value == 1);
}
......@@ -513,16 +505,11 @@ void GetExecutableVersionDetails(const std::wstring& exe_path,
GetValueFromVersionResource(data.get(), L"SpecialBuild", special_build);
}
}
*channel_name = GetChromeChannelName(true /* add_modifier */);
*channel_name = GetChromeChannelName();
}
std::wstring GetChromeChannelName(bool add_modifier) {
const std::wstring& channel = InstallDetails::Get().channel();
if (!add_modifier || !IsMultiInstall())
return channel;
if (channel.empty())
return L"m";
return channel + L"-m";
std::wstring GetChromeChannelName() {
return InstallDetails::Get().channel();
}
std::wstring GetBrowserCrashDumpAttemptsRegistryPath() {
......@@ -748,9 +735,7 @@ bool RecursiveDirectoryCreate(const std::wstring& full_path) {
// This function takes these inputs rather than accessing the module's
// InstallDetails instance since it is used to bootstrap InstallDetails.
std::wstring DetermineChannel(const InstallConstants& mode,
bool system_level,
bool multi_install) {
std::wstring DetermineChannel(const InstallConstants& mode, bool system_level) {
if (!kUseGoogleUpdateIntegration)
return std::wstring();
......@@ -759,7 +744,7 @@ std::wstring DetermineChannel(const InstallConstants& mode,
assert(false);
break;
case ChannelStrategy::ADDITIONAL_PARAMETERS:
return ChannelFromAdditionalParameters(mode, system_level, multi_install);
return ChannelFromAdditionalParameters(mode, system_level);
case ChannelStrategy::FIXED:
return mode.default_channel_name;
}
......
......@@ -53,9 +53,6 @@ template <typename T> inline void IgnoreUnused(T) {}
// Returns true if Chrome is running at system level.
bool IsSystemInstall();
// Returns true if current installation of Chrome is a multi-install.
bool IsMultiInstall();
// Returns true if usage stats collecting is enabled for this user for the
// current executable.
bool GetCollectStatsConsent();
......@@ -125,13 +122,10 @@ void GetExecutableVersionDetails(const std::wstring& exe_path,
std::wstring* channel_name);
// Gets the channel name for the current Chrome process.
// If |add_modifier| is true the channel name is returned with the modifier
// prepended to it. Currently this is only done for multi installs, i.e (-m)
// is the only modifier supported.
// TODO(ananta)
// http://crbug.com/604923
// Unify this with the Browser Distribution code.
std::wstring GetChromeChannelName(bool add_modifier);
std::wstring GetChromeChannelName();
// Returns the registry path where the browser crash dumps metrics need to be
// written to.
......@@ -184,9 +178,7 @@ bool RecursiveDirectoryCreate(const std::wstring& full_path);
// Returns the unadorned channel name based on the channel strategy for the
// install mode.
std::wstring DetermineChannel(const InstallConstants& mode,
bool system_level,
bool multi_install);
std::wstring DetermineChannel(const InstallConstants& mode, bool system_level);
// Caches the |ProcessType| of the current process.
extern ProcessType g_process_type;
......
......@@ -267,20 +267,17 @@ TEST(InstallStaticTest, BrowserProcessTest) {
class InstallStaticUtilTest
: public ::testing::TestWithParam<
std::tuple<InstallConstantIndex, const char*, const char*>> {
std::tuple<InstallConstantIndex, const char*>> {
protected:
InstallStaticUtilTest() {
InstallConstantIndex mode_index;
const char* level;
const char* mode;
std::tie(mode_index, level, mode) = GetParam();
std::tie(mode_index, level) = GetParam();
mode_ = &kInstallModes[mode_index];
system_level_ = std::string(level) != "user";
EXPECT_TRUE(!system_level_ || mode_->supports_system_level);
multi_install_ = std::string(mode) != "single";
EXPECT_TRUE(!multi_install_ || mode_->supports_multi_install);
root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
nt_root_key_ = system_level_ ? nt::HKLM : nt::HKCU;
......@@ -289,7 +286,6 @@ class InstallStaticUtilTest
details->set_mode(mode_);
details->set_channel(mode_->default_channel_name);
details->set_system_level(system_level_);
details->set_multi_install(multi_install_);
InstallDetails::SetForProcess(std::move(details));
base::string16 path;
......@@ -304,8 +300,6 @@ class InstallStaticUtilTest
bool system_level() const { return system_level_; }
bool multi_install() const { return multi_install_; }
const wchar_t* default_channel() const { return mode_->default_channel_name; }
void SetUsageStat(DWORD value, bool medium) {
......@@ -341,12 +335,7 @@ class InstallStaticUtilTest
if (medium)
result.append(L"Medium");
result.push_back(L'\\');
if (multi_install_)
result.append(kBinariesAppGuid);
else
result.append(mode_->app_guid);
} else if (multi_install_) {
result.append(kBinariesPathName);
result.append(mode_->app_guid);
} else {
result.append(kProductPathName);
}
......@@ -358,7 +347,6 @@ class InstallStaticUtilTest
nt::ROOT_KEY nt_root_key_ = nt::AUTO;
const InstallConstants* mode_ = nullptr;
bool system_level_ = false;
bool multi_install_ = false;
DISALLOW_COPY_AND_ASSIGN(InstallStaticUtilTest);
};
......@@ -423,37 +411,26 @@ TEST_P(InstallStaticUtilTest, UsageStatsPolicy) {
}
TEST_P(InstallStaticUtilTest, GetChromeChannelName) {
EXPECT_EQ(default_channel(), GetChromeChannelName(false));
std::wstring expected = default_channel();
if (multi_install()) {
if (expected.empty())
expected = L"m";
else
expected += L"-m";
}
EXPECT_EQ(expected, GetChromeChannelName(true));
EXPECT_EQ(default_channel(), GetChromeChannelName());
}
#if defined(GOOGLE_CHROME_BUILD)
// Stable supports multi-install at user and system levels.
// Stable supports user and system levels.
INSTANTIATE_TEST_CASE_P(Stable,
InstallStaticUtilTest,
testing::Combine(testing::Values(STABLE_INDEX),
testing::Values("user", "system"),
testing::Values("single", "multi")));
// Canary is single-only at user level.
testing::Values("user", "system")));
// Canary is only at user level.
INSTANTIATE_TEST_CASE_P(Canary,
InstallStaticUtilTest,
testing::Combine(testing::Values(CANARY_INDEX),
testing::Values("user"),
testing::Values("single")));
testing::Values("user")));
#else // GOOGLE_CHROME_BUILD
// Chromium supports multi-install at user and system levels.
// Chromium supports user and system levels.
INSTANTIATE_TEST_CASE_P(Chromium,
InstallStaticUtilTest,
testing::Combine(testing::Values(CHROMIUM_INDEX),
testing::Values("user", "system"),
testing::Values("single", "multi")));
testing::Values("user", "system")));
#endif // !GOOGLE_CHROME_BUILD
} // namespace install_static
......@@ -5,7 +5,6 @@
#include "chrome/install_static/product_install_details.h"
#include <windows.h>
#include <assert.h>
#include <algorithm>
......@@ -119,15 +118,6 @@ std::wstring GetInstallSuffix(const std::wstring& exe_path) {
(name - scan) - kProductPathNameLength);
}
bool IsMultiInstall(const InstallConstants& mode, bool system_level) {
assert(mode.supports_multi_install);
std::wstring args;
return nt::QueryRegValueSZ(system_level ? nt::HKLM : nt::HKCU, nt::WOW6432,
GetClientStateKeyPath(mode.app_guid).c_str(),
L"UninstallArguments", &args) &&
args.find(L"--multi-install") != std::wstring::npos;
}
std::unique_ptr<PrimaryInstallDetails> MakeProductDetails(
const std::wstring& exe_path) {
std::unique_ptr<PrimaryInstallDetails> details(new PrimaryInstallDetails());
......@@ -135,13 +125,10 @@ std::unique_ptr<PrimaryInstallDetails> MakeProductDetails(
const InstallConstants* mode = FindInstallMode(GetInstallSuffix(exe_path));
const bool system_level =
mode->supports_system_level && PathIsInProgramFiles(exe_path);
const bool multi_install =
mode->supports_multi_install && IsMultiInstall(*mode, system_level);
details->set_mode(mode);
details->set_system_level(system_level);
details->set_multi_install(multi_install);
details->set_channel(DetermineChannel(*mode, system_level, multi_install));
details->set_channel(DetermineChannel(*mode, system_level));
return details;
}
......
......@@ -12,7 +12,6 @@
namespace install_static {
struct InstallConstants;
class PrimaryInstallDetails;
// Creates product details for the current process and sets them as the global
......@@ -36,10 +35,6 @@ bool PathIsInProgramFiles(const std::wstring& path);
// "...\[kProductName][suffix]\Application".
std::wstring GetInstallSuffix(const std::wstring& exe_path);
// Returns true if the browser of |mode| at |system_level| is registered as
// being multi-install.
bool IsMultiInstall(const InstallConstants& mode, bool system_level);
// Creates product details for the process at |exe_path|.
std::unique_ptr<PrimaryInstallDetails> MakeProductDetails(
const std::wstring& exe_path);
......
......@@ -184,38 +184,20 @@ class MakeProductDetailsTest : public testing::TestWithParam<TestData> {
const TestData& test_data() const { return test_data_; }
void SetUninstallArguments(const wchar_t* value) {
ASSERT_THAT(
base::win::RegKey(root_key_, GetClientStateKeyPath(false).c_str(),
KEY_WOW64_32KEY | KEY_SET_VALUE)
.WriteValue(L"UninstallArguments", value),
Eq(ERROR_SUCCESS));
}
void SetAp(const wchar_t* value, bool binaries) {
ASSERT_TRUE(!binaries ||
kInstallModes[test_data().index].supports_multi_install);
ASSERT_THAT(
base::win::RegKey(root_key_, GetClientStateKeyPath(binaries).c_str(),
KEY_WOW64_32KEY | KEY_SET_VALUE)
.WriteValue(L"ap", value),
Eq(ERROR_SUCCESS));
void SetAp(const wchar_t* value) {
ASSERT_THAT(base::win::RegKey(root_key_, GetClientStateKeyPath().c_str(),
KEY_WOW64_32KEY | KEY_SET_VALUE)
.WriteValue(L"ap", value),
Eq(ERROR_SUCCESS));
}
private:
// Returns the registry path for the product's ClientState key.
std::wstring GetClientStateKeyPath(bool binaries) {
EXPECT_TRUE(!binaries ||
kInstallModes[test_data().index].supports_multi_install);
std::wstring GetClientStateKeyPath() {
std::wstring result(L"Software\\");
if (kUseGoogleUpdateIntegration) {
result.append(L"Google\\Update\\ClientState\\");
if (binaries)
result.append(kBinariesAppGuid);
else
result.append(kInstallModes[test_data().index].app_guid);
} else if (binaries) {
result.append(kBinariesPathName);
result.append(kInstallModes[test_data().index].app_guid);
} else {
result.append(kProductPathName);
}
......@@ -251,32 +233,6 @@ TEST_P(MakeProductDetailsTest, DefaultChannel) {
EXPECT_THAT(details->channel(), StrEq(test_data().channel));
}
// Test that multi-install is properly parsed out of the registry.
TEST_P(MakeProductDetailsTest, MultiInstall) {
{
std::unique_ptr<PrimaryInstallDetails> details(
MakeProductDetails(test_data().path));
EXPECT_FALSE(details->multi_install());
}
{
SetUninstallArguments(L"--uninstall");
std::unique_ptr<PrimaryInstallDetails> details(
MakeProductDetails(test_data().path));
EXPECT_FALSE(details->multi_install());
}
if (!kInstallModes[test_data().index].supports_multi_install)
return;
{
SetUninstallArguments(L"--uninstall --multi-install --chrome");
std::unique_ptr<PrimaryInstallDetails> details(
MakeProductDetails(test_data().path));
EXPECT_TRUE(details->multi_install());
}
}
// Test that the channel name is properly parsed out of additional parameters.
TEST_P(MakeProductDetailsTest, AdditionalParametersChannels) {
const std::pair<const wchar_t*, const wchar_t*> kApChannels[] = {
......@@ -292,10 +248,10 @@ TEST_P(MakeProductDetailsTest, AdditionalParametersChannels) {
{L"1.0-dev", L""},
{L"fuzzy", L""},
{L"foo", L""},
{L"-multi-chrome", L""},
{L"x64-stable-multi-chrome", L""},
{L"-stage:ensemble_patching-multi-chrome-full", L""},
{L"-multi-chrome-full", L""},
{L"-multi-chrome", L""}, // Legacy.
{L"x64-stable-multi-chrome", L""}, // Legacy.
{L"-stage:ensemble_patching-multi-chrome-full", L""}, // Legacy.
{L"-multi-chrome-full", L""}, // Legacy.
// beta
{L"1.1-beta", L"beta"},
{L"1.1-beta-full", L"beta"},
......@@ -317,25 +273,7 @@ TEST_P(MakeProductDetailsTest, AdditionalParametersChannels) {
};
for (const auto& ap_and_channel : kApChannels) {
SetAp(ap_and_channel.first, false);
std::unique_ptr<PrimaryInstallDetails> details(
MakeProductDetails(test_data().path));
if (kInstallModes[test_data().index].channel_strategy ==
ChannelStrategy::ADDITIONAL_PARAMETERS) {
EXPECT_THAT(details->channel(), StrEq(ap_and_channel.second));
} else {
// "ap" is ignored for this mode.
EXPECT_THAT(details->channel(), StrEq(test_data().channel));
}
}
if (!kInstallModes[test_data().index].supports_multi_install)
return;
// For multi-install modes, "ap" is pulled from the binaries' key.
for (const auto& ap_and_channel : kApChannels) {
SetAp(ap_and_channel.first, true);
SetUninstallArguments(L"--uninstall --multi-install --chrome");
SetAp(ap_and_channel.first);
std::unique_ptr<PrimaryInstallDetails> details(
MakeProductDetails(test_data().path));
if (kInstallModes[test_data().index].channel_strategy ==
......
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