Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Make 64-bit Chrome stable report as CHANNEL_STABLE
Browse files Browse the repository at this point in the history
BUG=407204
TEST=installer_util_unittests
TEST=install x64 stable.  Check chrome://chrome shows 'm' and not 'unknown-m'.

Review URL: https://codereview.chromium.org/467303004

Cr-Commit-Position: refs/heads/master@{#291791}
  • Loading branch information
wfh-chromium authored and Commit bot committed Aug 25, 2014
1 parent e9c7112 commit 7ebc2c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chrome/installer/util/channel_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const wchar_t kSfxMultiFail[] = L"-multifail";

const wchar_t* const kChannels[] = {
installer::kChromeChannelBeta,
installer::kChromeChannelDev
installer::kChromeChannelDev,
installer::kChromeChannelStableExplicit
};

const wchar_t* const kModifiers[] = {
Expand Down Expand Up @@ -168,7 +169,11 @@ bool ChannelInfo::GetChannelName(std::wstring* channel_name) const {
*const* end = &kChannels[arraysize(kChannels)]; scan != end;
++scan) {
if (value_.find(*scan) != std::wstring::npos) {
channel_name->assign(*scan);
// Report channels with "stable" in them as stable (empty string).
if (*scan == installer::kChromeChannelStableExplicit)
channel_name->erase();
else
channel_name->assign(*scan);
return true;
}
}
Expand Down
10 changes: 10 additions & 0 deletions chrome/installer/util/channel_info_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ TEST(ChannelInfoTest, Channels) {
EXPECT_TRUE(ci.GetChannelName(&channel));
EXPECT_EQ(kChannelDev, channel);

ci.set_value(L"x64-dev");
EXPECT_TRUE(ci.GetChannelName(&channel));
EXPECT_EQ(kChannelDev, channel);
ci.set_value(L"x64-beta");
EXPECT_TRUE(ci.GetChannelName(&channel));
EXPECT_EQ(kChannelBeta, channel);
ci.set_value(L"x64-stable");
EXPECT_TRUE(ci.GetChannelName(&channel));
EXPECT_EQ(kChannelStable, channel);

ci.set_value(L"fuzzy");
EXPECT_FALSE(ci.GetChannelName(&channel));
}
Expand Down
1 change: 1 addition & 0 deletions chrome/installer/util/util_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ const wchar_t kChromeChannelCanary[] = L"canary";
const wchar_t kChromeChannelDev[] = L"dev";
const wchar_t kChromeChannelBeta[] = L"beta";
const wchar_t kChromeChannelStable[] = L"";
const wchar_t kChromeChannelStableExplicit[] = L"stable";

const size_t kMaxAppModelIdLength = 64U;

Expand Down
1 change: 1 addition & 0 deletions chrome/installer/util/util_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ extern const wchar_t kChromeChannelCanary[];
extern const wchar_t kChromeChannelDev[];
extern const wchar_t kChromeChannelBeta[];
extern const wchar_t kChromeChannelStable[];
extern const wchar_t kChromeChannelStableExplicit[];

extern const size_t kMaxAppModelIdLength;

Expand Down

0 comments on commit 7ebc2c4

Please sign in to comment.