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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 scoped_ptr<base::ListValue> enabled_list(new base::ListValue); | 151 scoped_ptr<base::ListValue> enabled_list(new base::ListValue); |
152 for (size_t i = 0; i < enabled_features.size(); ++i) | 152 for (size_t i = 0; i < enabled_features.size(); ++i) |
153 enabled_list->AppendString(enabled_features[i]); | 153 enabled_list->AppendString(enabled_features[i]); |
154 test_arg.Set(kEnabledFeaturesKey, enabled_list.release()); | 154 test_arg.Set(kEnabledFeaturesKey, enabled_list.release()); |
155 | 155 |
156 scoped_ptr<base::ListValue> disabled_list(new base::ListValue); | 156 scoped_ptr<base::ListValue> disabled_list(new base::ListValue); |
157 for (size_t i = 0; i < disabled_features.size(); ++i) | 157 for (size_t i = 0; i < disabled_features.size(); ++i) |
158 disabled_list->AppendString(disabled_features[i]); | 158 disabled_list->AppendString(disabled_features[i]); |
159 test_arg.Set(kDisabledFeaturesKey, disabled_list.release()); | 159 test_arg.Set(kDisabledFeaturesKey, disabled_list.release()); |
160 | 160 |
161 return base::JSONWriter::Write(&test_arg, result); | 161 return base::JSONWriter::Write(test_arg, result); |
162 } | 162 } |
163 }; | 163 }; |
164 | 164 |
165 INSTANTIATE_TEST_CASE_P(AccessibilityFeatureaApiTestInstantiatePermission, | 165 INSTANTIATE_TEST_CASE_P(AccessibilityFeatureaApiTestInstantiatePermission, |
166 AccessibilityFeaturesApiTest, | 166 AccessibilityFeaturesApiTest, |
167 testing::Bool()); | 167 testing::Bool()); |
168 | 168 |
169 // Tests that an extension with read permission can read accessibility features | 169 // Tests that an extension with read permission can read accessibility features |
170 // state, while an extension that doesn't have the permission cannot. | 170 // state, while an extension that doesn't have the permission cannot. |
171 IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Get) { | 171 IN_PROC_BROWSER_TEST_P(AccessibilityFeaturesApiTest, Get) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 InitPrefServiceForTest(GetPrefs(), disabled_features, enabled_features)); | 268 InitPrefServiceForTest(GetPrefs(), disabled_features, enabled_features)); |
269 | 269 |
270 // Catch the second result notification sent by the test extension. | 270 // Catch the second result notification sent by the test extension. |
271 ResultCatcher result_catcher; | 271 ResultCatcher result_catcher; |
272 ASSERT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); | 272 ASSERT_TRUE(result_catcher.GetNextResult()) << result_catcher.message(); |
273 } | 273 } |
274 | 274 |
275 } // namespace | 275 } // namespace |
276 | 276 |
277 } // namespace extensions | 277 } // namespace extensions |
OLD | NEW |