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 <algorithm> | 5 #include <algorithm> |
6 #include <cstdlib> | 6 #include <cstdlib> |
7 #include <map> | 7 #include <map> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 const std::string os("linux"); | 171 const std::string os("linux"); |
172 #else | 172 #else |
173 #error "Unknown platform" | 173 #error "Unknown platform" |
174 #endif | 174 #endif |
175 return std::find(supported_os_.begin(), supported_os_.end(), os) != | 175 return std::find(supported_os_.begin(), supported_os_.end(), os) != |
176 supported_os_.end(); | 176 supported_os_.end(); |
177 } | 177 } |
178 void AddSupportedOs(const std::string& os) { supported_os_.push_back(os); } | 178 void AddSupportedOs(const std::string& os) { supported_os_.push_back(os); } |
179 | 179 |
180 bool IsSupported() const { | 180 bool IsSupported() const { |
181 #if !defined(OFFICIAL_BUILD) | 181 #if !defined(GOOGLE_CHROME_BUILD) |
182 if (is_official_only()) | 182 if (is_official_only()) |
183 return false; | 183 return false; |
184 #endif | 184 #endif |
185 return IsOsSupported(); | 185 return IsOsSupported(); |
186 } | 186 } |
187 | 187 |
188 const base::DictionaryValue& test_policy() const { return test_policy_; } | 188 const base::DictionaryValue& test_policy() const { return test_policy_; } |
189 void SetTestPolicy(const base::DictionaryValue& policy) { | 189 void SetTestPolicy(const base::DictionaryValue& policy) { |
190 test_policy_.Clear(); | 190 test_policy_.Clear(); |
191 test_policy_.MergeDictionary(&policy); | 191 test_policy_.MergeDictionary(&policy); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 IN_PROC_BROWSER_TEST_P(PolicyPrefIndicatorTest, CheckPolicyIndicators) { | 604 IN_PROC_BROWSER_TEST_P(PolicyPrefIndicatorTest, CheckPolicyIndicators) { |
605 const PolicyTestCases test_cases; | 605 const PolicyTestCases test_cases; |
606 PrefService* local_state = g_browser_process->local_state(); | 606 PrefService* local_state = g_browser_process->local_state(); |
607 PrefService* user_prefs = browser()->profile()->GetPrefs(); | 607 PrefService* user_prefs = browser()->profile()->GetPrefs(); |
608 | 608 |
609 ui_test_utils::NavigateToURL(browser(), GURL(kMainSettingsPage)); | 609 ui_test_utils::NavigateToURL(browser(), GURL(kMainSettingsPage)); |
610 | 610 |
611 for (std::vector<std::string>::const_iterator policy = GetParam().begin(); | 611 for (std::vector<std::string>::const_iterator policy = GetParam().begin(); |
612 policy != GetParam().end(); | 612 policy != GetParam().end(); |
613 ++policy) { | 613 ++policy) { |
614 // Skipping the test for |MetricsReportingEnabled| as the corresponding | |
615 // checkbox is not using prefs anymore. | |
616 // TODO(gayane): New tests should be created to cover | |
617 // |MetricsReportingEnabled| crbug.com/414945 | |
618 if (*policy == "MetricsReportingEnabled") | |
619 continue; | |
bartfab (slow)
2014/09/19 14:56:37
The correct thing to do is to remove the "indicato
gayane -on leave until 09-2017
2014/09/19 15:24:33
If I only remove test case from the json file, the
gayane1
2014/09/19 15:35:41
Ah I see, you meant not the whole test case but ju
| |
614 const std::vector<PolicyTestCase*>* policy_test_cases = | 620 const std::vector<PolicyTestCase*>* policy_test_cases = |
615 test_cases.Get(*policy); | 621 test_cases.Get(*policy); |
616 ASSERT_TRUE(policy_test_cases) << "PolicyTestCase not found for " | 622 ASSERT_TRUE(policy_test_cases) << "PolicyTestCase not found for " |
617 << *policy; | 623 << *policy; |
618 for (std::vector<PolicyTestCase*>::const_iterator test_case = | 624 for (std::vector<PolicyTestCase*>::const_iterator test_case = |
619 policy_test_cases->begin(); | 625 policy_test_cases->begin(); |
620 test_case != policy_test_cases->end(); | 626 test_case != policy_test_cases->end(); |
621 ++test_case) { | 627 ++test_case) { |
622 PolicyTestCase* policy_test_case = *test_case; | 628 PolicyTestCase* policy_test_case = *test_case; |
623 if (!policy_test_case->IsSupported()) | 629 if (!policy_test_case->IsSupported()) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
744 } | 750 } |
745 } | 751 } |
746 } | 752 } |
747 } | 753 } |
748 | 754 |
749 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, | 755 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, |
750 PolicyPrefIndicatorTest, | 756 PolicyPrefIndicatorTest, |
751 testing::ValuesIn(SplitPoliciesIntoChunks(10))); | 757 testing::ValuesIn(SplitPoliciesIntoChunks(10))); |
752 | 758 |
753 } // namespace policy | 759 } // namespace policy |
OLD | NEW |