Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2921)

Unified Diff: chrome/installer/util/channel_info_unittest.cc

Issue 6288009: More installer refactoring in the interest of fixing some bugs and cleaning t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/channel_info_unittest.cc
===================================================================
--- chrome/installer/util/channel_info_unittest.cc (revision 71802)
+++ chrome/installer/util/channel_info_unittest.cc (working copy)
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
+#include "base/basictypes.h"
#include "chrome/installer/util/channel_info.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -158,3 +161,36 @@
ci.set_value(L"2.0-beta-chromeframe-chrome");
EXPECT_TRUE(ci.IsChrome());
}
+
+TEST(ChannelInfoTest, EqualsBaseOf) {
+ installer::ChannelInfo ci1;
+ installer::ChannelInfo ci2;
+
+ std::pair<std::wstring, std::wstring> trues[] = {
+ std::make_pair(std::wstring(L""), std::wstring(L"")),
+ std::make_pair(std::wstring(L"2.0-beta"), std::wstring(L"2.0-beta")),
+ std::make_pair(std::wstring(L"-full"), std::wstring(L"-full")),
+ std::make_pair(std::wstring(L""), std::wstring(L"-multi"))
+ };
+ for (int i = 0; i < arraysize(trues); ++i) {
+ std::pair<std::wstring, std::wstring>& the_pair = trues[i];
+ ci1.set_value(the_pair.first);
+ ci2.set_value(the_pair.second);
+ EXPECT_TRUE(ci1.EqualsBaseOf(ci2)) << the_pair.first << " "
+ << the_pair.second;
+ }
+
+ std::pair<std::wstring, std::wstring> falses[] = {
+ std::make_pair(std::wstring(L""), std::wstring(L"2.0-beta")),
+ std::make_pair(std::wstring(L"2.0-gamma"), std::wstring(L"2.0-beta")),
+ std::make_pair(std::wstring(L"spam-full"), std::wstring(L"-full")),
+ std::make_pair(std::wstring(L"multi"), std::wstring(L"-multi"))
+ };
+ for (int i = 0; i < arraysize(falses); ++i) {
+ std::pair<std::wstring, std::wstring>& the_pair = falses[i];
+ ci1.set_value(the_pair.first);
+ ci2.set_value(the_pair.second);
+ EXPECT_FALSE(ci1.EqualsBaseOf(ci2)) << the_pair.first << " "
+ << the_pair.second;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698