OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // test configuration. | 143 // test configuration. |
144 // The result is saved to |result|. The return value is whether the test | 144 // The result is saved to |result|. The return value is whether the test |
145 // argument was successfully generated. | 145 // argument was successfully generated. |
146 bool GenerateTestArg(const std::string& test_name, | 146 bool GenerateTestArg(const std::string& test_name, |
147 const std::vector<std::string>& enabled_features, | 147 const std::vector<std::string>& enabled_features, |
148 const std::vector<std::string>& disabled_features, | 148 const std::vector<std::string>& disabled_features, |
149 std::string* result) { | 149 std::string* result) { |
150 base::DictionaryValue test_arg; | 150 base::DictionaryValue test_arg; |
151 test_arg.SetString(kTestNameKey, test_name); | 151 test_arg.SetString(kTestNameKey, test_name); |
152 | 152 |
153 scoped_ptr<base::ListValue> enabled_list(new base::ListValue); | 153 std::unique_ptr<base::ListValue> enabled_list(new base::ListValue); |
154 for (size_t i = 0; i < enabled_features.size(); ++i) | 154 for (size_t i = 0; i < enabled_features.size(); ++i) |
155 enabled_list->AppendString(enabled_features[i]); | 155 enabled_list->AppendString(enabled_features[i]); |
156 test_arg.Set(kEnabledFeaturesKey, enabled_list.release()); | 156 test_arg.Set(kEnabledFeaturesKey, enabled_list.release()); |
157 | 157 |
158 scoped_ptr<base::ListValue> disabled_list(new base::ListValue); | 158 std::unique_ptr<base::ListValue> disabled_list(new base::ListValue); |
159 for (size_t i = 0; i < disabled_features.size(); ++i) | 159 for (size_t i = 0; i < disabled_features.size(); ++i) |
160 disabled_list->AppendString(disabled_features[i]); | 160 disabled_list->AppendString(disabled_features[i]); |
161 test_arg.Set(kDisabledFeaturesKey, disabled_list.release()); | 161 test_arg.Set(kDisabledFeaturesKey, disabled_list.release()); |
162 | 162 |
163 return base::JSONWriter::Write(test_arg, result); | 163 return base::JSONWriter::Write(test_arg, result); |
164 } | 164 } |
165 }; | 165 }; |
166 | 166 |
167 INSTANTIATE_TEST_CASE_P(AccessibilityFeatureaApiTestInstantiatePermission, | 167 INSTANTIATE_TEST_CASE_P(AccessibilityFeatureaApiTestInstantiatePermission, |
168 AccessibilityFeaturesApiTest, | 168 AccessibilityFeaturesApiTest, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 InitPrefServiceForTest(GetPrefs(), disabled_features, enabled_features)); | 270 InitPrefServiceForTest(GetPrefs(), disabled_features, enabled_features)); |
271 | 271 |
272 // Catch the second result notification sent by the test extension. | 272 // Catch the second result notification sent by the test extension. |
273 ResultCatcher result_catcher; | 273 ResultCatcher result_catcher; |
274 ASSERT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); | 274 ASSERT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); |
275 } | 275 } |
276 | 276 |
277 } // namespace | 277 } // namespace |
278 | 278 |
279 } // namespace extensions | 279 } // namespace extensions |
OLD | NEW |