OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/tools/disable_outdated_build_detector/google_update_integration
.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace { |
| 10 |
| 11 // Copied from chrome/browser/google/google_brand.cc. |
| 12 const wchar_t* const kOrganicBrands[] = { |
| 13 L"CHCA", L"CHCB", L"CHCG", L"CHCH", L"CHCI", L"CHCJ", L"CHCK", L"CHCL", |
| 14 L"CHFO", L"CHFT", L"CHHS", L"CHHM", L"CHMA", L"CHMB", L"CHME", L"CHMF", |
| 15 L"CHMG", L"CHMH", L"CHMI", L"CHMQ", L"CHMV", L"CHNB", L"CHNC", L"CHNG", |
| 16 L"CHNH", L"CHNI", L"CHOA", L"CHOB", L"CHOC", L"CHON", L"CHOO", L"CHOP", |
| 17 L"CHOQ", L"CHOR", L"CHOS", L"CHOT", L"CHOU", L"CHOX", L"CHOY", L"CHOZ", |
| 18 L"CHPD", L"CHPE", L"CHPF", L"CHPG", L"ECBA", L"ECBB", L"ECDA", L"ECDB", |
| 19 L"ECSA", L"ECSB", L"ECVA", L"ECVB", L"ECWA", L"ECWB", L"ECWC", L"ECWD", |
| 20 L"ECWE", L"ECWF", L"EUBB", L"EUBC", L"GGLA", L"GGLS", |
| 21 |
| 22 // EUB* |
| 23 L"EUBQ", |
| 24 |
| 25 // EUC* |
| 26 L"EUCQ", |
| 27 |
| 28 // GGR* |
| 29 L"GGRQ", |
| 30 }; |
| 31 |
| 32 } // namespace |
| 33 |
| 34 // Test that all expected brands are considered organic. |
| 35 class IsOrganicTest : public ::testing::TestWithParam<const wchar_t*> {}; |
| 36 |
| 37 TEST_P(IsOrganicTest, IsOrganicBrand) { |
| 38 EXPECT_TRUE(IsOrganic(GetParam())); |
| 39 } |
| 40 |
| 41 INSTANTIATE_TEST_CASE_P(OrganicBrands, |
| 42 IsOrganicTest, |
| 43 ::testing::ValuesIn(kOrganicBrands)); |
| 44 |
| 45 // Test that a smattering of non-organic brands are not considered organic. |
| 46 class IsNotOrganicTest : public ::testing::TestWithParam<const wchar_t*> {}; |
| 47 |
| 48 TEST_P(IsNotOrganicTest, IsNotOrganicBrand) { |
| 49 EXPECT_FALSE(IsOrganic(GetParam())); |
| 50 } |
| 51 |
| 52 INSTANTIATE_TEST_CASE_P(NonOrganicBrands, |
| 53 IsNotOrganicTest, |
| 54 ::testing::Values(L"AOHY", L"YAKS", L"")); |
OLD | NEW |