Index: chrome/installer/setup/brand_constants_unittest.cc |
diff --git a/chrome/installer/setup/brand_constants_unittest.cc b/chrome/installer/setup/brand_constants_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..df5218670eb7875429077349ebf6c2cbcf6e8450 |
--- /dev/null |
+++ b/chrome/installer/setup/brand_constants_unittest.cc |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/installer/setup/brand_constants.h" |
+ |
+#include "chrome/install_static/install_modes.h" |
+#include "testing/gmock/include/gmock/gmock.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+using ::testing::Eq; |
+using ::testing::StrEq; |
+using ::testing::StrNe; |
+ |
+TEST(BrandConstants, VerifyConstants) { |
+ for (int i = 0; i < install_static::NUM_INSTALL_MODES; ++i) { |
+ const BrandConstants& brand = kBrandConstants[i]; |
+ |
+ // The brands must be listed in order. |
+ ASSERT_THAT(brand.index, Eq(i)); |
+ |
+ // The first must have no install switch; the rest must have one. |
+ if (i == 0) |
+ ASSERT_THAT(brand.install_switch, StrEq("")); |
+ else |
+ ASSERT_THAT(brand.install_switch, StrNe("")); |
+ |
+ // The first must have no logo suffix; the rest must have one. |
+ if (i == 0) |
+ ASSERT_THAT(brand.logo_suffix, StrEq(L"")); |
+ else |
+ ASSERT_THAT(brand.logo_suffix, StrNe(L"")); |
+ } |
+} |