Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(937)

Side by Side Diff: chrome/common/extensions/features/base_feature_provider_unittest.cc

Issue 13971005: Basic multi-module support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix copyright for presubmit Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/common/extensions/features/base_feature_provider.h" 5 #include "chrome/common/extensions/features/base_feature_provider.h"
6 6
7 #include "chrome/common/extensions/extension_unittest.h" 7 #include "chrome/common/extensions/extension_unittest.h"
8 #include "chrome/common/extensions/features/permission_feature.h" 8 #include "chrome/common/extensions/features/permission_feature.h"
9 #include "chrome/common/extensions/value_builder.h" 9 #include "chrome/common/extensions/value_builder.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using chrome::VersionInfo; 12 using chrome::VersionInfo;
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 class BaseFeatureProviderTest : public ExtensionTest { 16 class BaseFeatureProviderTest : public ExtensionTest {
17 }; 17 };
18 18
19 TEST_F(BaseFeatureProviderTest, ManifestFeatures) { 19 TEST_F(BaseFeatureProviderTest, ManifestFeatures) {
20 FeatureProvider* provider = BaseFeatureProvider::GetByName("manifest"); 20 FeatureProvider* provider = BaseFeatureProvider::GetByName("manifest");
21 SimpleFeature* feature = 21 SimpleFeature* feature =
22 static_cast<SimpleFeature*>(provider->GetFeature("description")); 22 static_cast<SimpleFeature*>(provider->GetFeature("description"));
23 ASSERT_TRUE(feature); 23 ASSERT_TRUE(feature);
24 EXPECT_EQ(5u, feature->extension_types()->size()); 24 EXPECT_EQ(6u, feature->extension_types()->size());
25 EXPECT_EQ(1u, feature->extension_types()->count(Manifest::TYPE_EXTENSION)); 25 EXPECT_EQ(1u, feature->extension_types()->count(Manifest::TYPE_EXTENSION));
26 EXPECT_EQ(1u, 26 EXPECT_EQ(1u,
27 feature->extension_types()->count(Manifest::TYPE_LEGACY_PACKAGED_APP)); 27 feature->extension_types()->count(Manifest::TYPE_LEGACY_PACKAGED_APP));
28 EXPECT_EQ(1u, 28 EXPECT_EQ(1u,
29 feature->extension_types()->count(Manifest::TYPE_PLATFORM_APP)); 29 feature->extension_types()->count(Manifest::TYPE_PLATFORM_APP));
30 EXPECT_EQ(1u, feature->extension_types()->count(Manifest::TYPE_HOSTED_APP)); 30 EXPECT_EQ(1u, feature->extension_types()->count(Manifest::TYPE_HOSTED_APP));
31 EXPECT_EQ(1u, feature->extension_types()->count(Manifest::TYPE_THEME)); 31 EXPECT_EQ(1u, feature->extension_types()->count(Manifest::TYPE_THEME));
32 EXPECT_EQ(1u,
33 feature->extension_types()->count(Manifest::TYPE_SHARED_MODULE));
32 34
33 base::DictionaryValue manifest; 35 base::DictionaryValue manifest;
34 manifest.SetString("name", "test extension"); 36 manifest.SetString("name", "test extension");
35 manifest.SetString("version", "1"); 37 manifest.SetString("version", "1");
36 manifest.SetString("description", "hello there"); 38 manifest.SetString("description", "hello there");
37 39
38 std::string error; 40 std::string error;
39 scoped_refptr<const Extension> extension(Extension::Create( 41 scoped_refptr<const Extension> extension(Extension::Create(
40 base::FilePath(), Manifest::INTERNAL, manifest, Extension::NO_FLAGS, 42 base::FilePath(), Manifest::INTERNAL, manifest, Extension::NO_FLAGS,
41 &error)); 43 &error));
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 Feature::UNSPECIFIED_PLATFORM).result()); 182 Feature::UNSPECIFIED_PLATFORM).result());
181 EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest( 183 EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
182 "2", 184 "2",
183 Manifest::TYPE_LEGACY_PACKAGED_APP, 185 Manifest::TYPE_LEGACY_PACKAGED_APP,
184 Feature::UNSPECIFIED_LOCATION, 186 Feature::UNSPECIFIED_LOCATION,
185 Feature::UNSPECIFIED_PLATFORM).result()); 187 Feature::UNSPECIFIED_PLATFORM).result());
186 } 188 }
187 } 189 }
188 190
189 } // namespace extensions 191 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_manifest_constants.cc ('k') | chrome/common/extensions/features/simple_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698