OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "chrome/installer/util/channel_info.h" |
| 6 |
5 #include <utility> | 7 #include <utility> |
6 | 8 |
7 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
8 #include "chrome/installer/util/channel_info.h" | |
9 #include "chrome/installer/util/util_constants.h" | 10 #include "chrome/installer/util/util_constants.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 using installer::ChannelInfo; | 13 using installer::ChannelInfo; |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 const std::wstring kChannelStable(installer::kChromeChannelStable); | 17 const base::string16 kChannelStable(installer::kChromeChannelStable); |
17 const std::wstring kChannelBeta(installer::kChromeChannelBeta); | 18 const base::string16 kChannelBeta(installer::kChromeChannelBeta); |
18 const std::wstring kChannelDev(installer::kChromeChannelDev); | 19 const base::string16 kChannelDev(installer::kChromeChannelDev); |
19 | 20 |
20 } // namespace | 21 } // namespace |
21 | 22 |
22 TEST(ChannelInfoTest, Channels) { | 23 TEST(ChannelInfoTest, Channels) { |
23 ChannelInfo ci; | 24 ChannelInfo ci; |
24 std::wstring channel; | 25 base::string16 channel; |
25 | 26 |
26 ci.set_value(L""); | 27 ci.set_value(L""); |
27 EXPECT_TRUE(ci.GetChannelName(&channel)); | 28 EXPECT_TRUE(ci.GetChannelName(&channel)); |
28 EXPECT_EQ(kChannelStable, channel); | 29 EXPECT_EQ(kChannelStable, channel); |
29 ci.set_value(L"-full"); | 30 ci.set_value(L"-full"); |
30 EXPECT_TRUE(ci.GetChannelName(&channel)); | 31 EXPECT_TRUE(ci.GetChannelName(&channel)); |
31 EXPECT_EQ(kChannelStable, channel); | 32 EXPECT_EQ(kChannelStable, channel); |
32 | 33 |
33 ci.set_value(L"2.0-beta"); | 34 ci.set_value(L"2.0-beta"); |
34 EXPECT_TRUE(ci.GetChannelName(&channel)); | 35 EXPECT_TRUE(ci.GetChannelName(&channel)); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 ChannelInfo ci; | 252 ChannelInfo ci; |
252 | 253 |
253 ci.set_value(L""); | 254 ci.set_value(L""); |
254 EXPECT_FALSE(ci.RemoveAllModifiersAndSuffixes()); | 255 EXPECT_FALSE(ci.RemoveAllModifiersAndSuffixes()); |
255 EXPECT_EQ(L"", ci.value()); | 256 EXPECT_EQ(L"", ci.value()); |
256 | 257 |
257 ci.set_value(L"2.0-dev-multi-chrome-chromeframe-migrating"); | 258 ci.set_value(L"2.0-dev-multi-chrome-chromeframe-migrating"); |
258 EXPECT_TRUE(ci.RemoveAllModifiersAndSuffixes()); | 259 EXPECT_TRUE(ci.RemoveAllModifiersAndSuffixes()); |
259 EXPECT_EQ(L"2.0-dev", ci.value()); | 260 EXPECT_EQ(L"2.0-dev", ci.value()); |
260 } | 261 } |
OLD | NEW |