| Index: chrome/installer/util/channel_info_unittest.cc
|
| diff --git a/chrome/installer/util/channel_info_unittest.cc b/chrome/installer/util/channel_info_unittest.cc
|
| index 71d908b6e2123f453d6c6e110e2e9d332b6216be..be112f92138949981bc51f53932fd489e917ed83 100644
|
| --- a/chrome/installer/util/channel_info_unittest.cc
|
| +++ b/chrome/installer/util/channel_info_unittest.cc
|
| @@ -2,10 +2,11 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome/installer/util/channel_info.h"
|
| +
|
| #include <utility>
|
|
|
| #include "base/basictypes.h"
|
| -#include "chrome/installer/util/channel_info.h"
|
| #include "chrome/installer/util/util_constants.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -13,15 +14,15 @@ using installer::ChannelInfo;
|
|
|
| namespace {
|
|
|
| -const std::wstring kChannelStable(installer::kChromeChannelStable);
|
| -const std::wstring kChannelBeta(installer::kChromeChannelBeta);
|
| -const std::wstring kChannelDev(installer::kChromeChannelDev);
|
| +const base::string16 kChannelStable(installer::kChromeChannelStable);
|
| +const base::string16 kChannelBeta(installer::kChromeChannelBeta);
|
| +const base::string16 kChannelDev(installer::kChromeChannelDev);
|
|
|
| } // namespace
|
|
|
| TEST(ChannelInfoTest, Channels) {
|
| ChannelInfo ci;
|
| - std::wstring channel;
|
| + base::string16 channel;
|
|
|
| ci.set_value(L"");
|
| EXPECT_TRUE(ci.GetChannelName(&channel));
|
| @@ -258,3 +259,35 @@ TEST(ChannelInfoTest, RemoveAllModifiersAndSuffixes) {
|
| EXPECT_TRUE(ci.RemoveAllModifiersAndSuffixes());
|
| EXPECT_EQ(L"2.0-dev", ci.value());
|
| }
|
| +
|
| +TEST(ChannelInfoTest, AuditValue) {
|
| +#if defined(GOOGLE_CHROME_BUILD)
|
| + struct {
|
| + base::string16 expected;
|
| + base::string16 input;
|
| + } test_cases[] = {
|
| + {L"", L""},
|
| + {L"-multi", L"-multi"},
|
| + {L"", L"-apphost"},
|
| + {L"-multi", L"-multi-apphost"},
|
| + {L"-multi", L"-apphost-multi"},
|
| + {L"-multi-stage:spammy", L"-multi-apphost-stage:spammy"},
|
| + {L"-multi-apphostlike-chrome", L"-multi-apphostlike-chrome"},
|
| + {L"-multi-APPLAUNCHER-chrome", L"-multi-APPLAUNCHER-chrome"},
|
| + {L"", L"-apphost-applauncher"},
|
| + {L"-multi", L"-apphost-multi-applauncher"},
|
| + {L"2.0-beta-multi-stage", L"2.0-beta-applauncher-multi-apphost-stage"},
|
| + };
|
| + for (int i = 0; i < arraysize(test_cases); ++i) {
|
| + base::string16 value = test_cases[i].input;
|
| + ChannelInfo::AuditValue(&value);
|
| + EXPECT_EQ(test_cases[i].expected, value)
|
| + << "test_cases[" << i << "] failed direct call.";
|
| +
|
| + ChannelInfo ci;
|
| + ci.set_value(test_cases[i].input);
|
| + EXPECT_EQ(test_cases[i].expected, ci.value())
|
| + << "test_cases[" << i << "] failed through CannelInfo.";
|
| + }
|
| +#endif
|
| +}
|
|
|