OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "extensions/common/features/complex_feature.h" | 5 #include "extensions/common/features/complex_feature.h" |
6 #include "extensions/common/features/feature.h" | 6 #include "extensions/common/features/feature.h" |
7 #include "extensions/common/features/simple_feature.h" | 7 #include "extensions/common/features/simple_feature.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "tools/json_schema_compiler/test/features_compiler_test.h" | 9 #include "tools/json_schema_compiler/test/features_compiler_test.h" |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 comparator.channel.reset( | 185 comparator.channel.reset( |
186 new version_info::Channel(version_info::Channel::DEV)); | 186 new version_info::Channel(version_info::Channel::DEV)); |
187 comparator.matches.AddPattern( | 187 comparator.matches.AddPattern( |
188 URLPattern(URLPattern::SCHEME_ALL, "*://example.com/*")); | 188 URLPattern(URLPattern::SCHEME_ALL, "*://example.com/*")); |
189 comparator.min_manifest_version = 2; | 189 comparator.min_manifest_version = 2; |
190 comparator.CompareFeature(feature); | 190 comparator.CompareFeature(feature); |
191 } | 191 } |
192 { | 192 { |
193 SimpleFeature* feature = GetAsSimpleFeature("allEnum"); | 193 SimpleFeature* feature = GetAsSimpleFeature("allEnum"); |
194 FeatureComparator comparator("allEnum"); | 194 FeatureComparator comparator("allEnum"); |
195 comparator.contexts = { | 195 comparator.contexts = {Feature::BLESSED_EXTENSION_CONTEXT, |
196 Feature::BLESSED_EXTENSION_CONTEXT, Feature::BLESSED_WEB_PAGE_CONTEXT, | 196 Feature::BLESSED_WEB_PAGE_CONTEXT, |
197 Feature::CONTENT_SCRIPT_CONTEXT, Feature::SERVICE_WORKER_CONTEXT, | 197 Feature::CONTENT_SCRIPT_CONTEXT, |
198 Feature::WEB_PAGE_CONTEXT, Feature::WEBUI_CONTEXT, | 198 Feature::LOCK_SCREEN_EXTENSION_CONTEXT, |
199 Feature::UNBLESSED_EXTENSION_CONTEXT}; | 199 Feature::SERVICE_WORKER_CONTEXT, |
| 200 Feature::WEB_PAGE_CONTEXT, |
| 201 Feature::WEBUI_CONTEXT, |
| 202 Feature::UNBLESSED_EXTENSION_CONTEXT}; |
200 comparator.extension_types = { | 203 comparator.extension_types = { |
201 Manifest::TYPE_EXTENSION, Manifest::TYPE_HOSTED_APP, | 204 Manifest::TYPE_EXTENSION, Manifest::TYPE_HOSTED_APP, |
202 Manifest::TYPE_LEGACY_PACKAGED_APP, Manifest::TYPE_PLATFORM_APP, | 205 Manifest::TYPE_LEGACY_PACKAGED_APP, Manifest::TYPE_PLATFORM_APP, |
203 Manifest::TYPE_SHARED_MODULE, Manifest::TYPE_THEME}; | 206 Manifest::TYPE_SHARED_MODULE, Manifest::TYPE_THEME}; |
204 comparator.channel.reset( | 207 comparator.channel.reset( |
205 new version_info::Channel(version_info::Channel::BETA)); | 208 new version_info::Channel(version_info::Channel::BETA)); |
206 comparator.CompareFeature(feature); | 209 comparator.CompareFeature(feature); |
207 } | 210 } |
208 { | 211 { |
209 // Omega is imported from a second .json file. | 212 // Omega is imported from a second .json file. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 ASSERT_EQ("", feature->source()); | 325 ASSERT_EQ("", feature->source()); |
323 } | 326 } |
324 { | 327 { |
325 Feature* feature = provider.GetFeature("alias_parent.child"); | 328 Feature* feature = provider.GetFeature("alias_parent.child"); |
326 ASSERT_EQ("", feature->alias()); | 329 ASSERT_EQ("", feature->alias()); |
327 ASSERT_EQ("child_source", feature->source()); | 330 ASSERT_EQ("child_source", feature->source()); |
328 } | 331 } |
329 } | 332 } |
330 | 333 |
331 } // namespace extensions | 334 } // namespace extensions |
OLD | NEW |