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

Side by Side Diff: chrome/common/extensions/api/extension_api_unittest.cc

Issue 241673002: Support a "policy" extension location in extension features files. At the same (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: format Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/features/chrome_channel_feature_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "extensions/common/extension_api.h" 5 #include "extensions/common/extension_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 SimpleFeature* feature = test_data[i].feature; 699 SimpleFeature* feature = test_data[i].feature;
700 ASSERT_TRUE(feature) << i; 700 ASSERT_TRUE(feature) << i;
701 701
702 EXPECT_TRUE(feature->whitelist()->empty()); 702 EXPECT_TRUE(feature->whitelist()->empty());
703 EXPECT_TRUE(feature->extension_types()->empty()); 703 EXPECT_TRUE(feature->extension_types()->empty());
704 704
705 EXPECT_EQ(1u, feature->GetContexts()->size()); 705 EXPECT_EQ(1u, feature->GetContexts()->size());
706 EXPECT_TRUE(feature->GetContexts()->count( 706 EXPECT_TRUE(feature->GetContexts()->count(
707 Feature::BLESSED_EXTENSION_CONTEXT)); 707 Feature::BLESSED_EXTENSION_CONTEXT));
708 708
709 EXPECT_EQ(Feature::UNSPECIFIED_LOCATION, feature->location()); 709 EXPECT_EQ(SimpleFeature::UNSPECIFIED_LOCATION, feature->location());
710 EXPECT_TRUE(feature->platforms()->empty()); 710 EXPECT_TRUE(feature->platforms()->empty());
711 EXPECT_EQ(0, feature->min_manifest_version()); 711 EXPECT_EQ(0, feature->min_manifest_version());
712 EXPECT_EQ(0, feature->max_manifest_version()); 712 EXPECT_EQ(0, feature->max_manifest_version());
713 } 713 }
714 } 714 }
715 715
716 TEST(ExtensionAPITest, FeaturesRequireContexts) { 716 TEST(ExtensionAPITest, FeaturesRequireContexts) {
717 // TODO(cduvall): Make this check API featues. 717 // TODO(cduvall): Make this check API featues.
718 scoped_ptr<base::DictionaryValue> api_features1(new base::DictionaryValue()); 718 scoped_ptr<base::DictionaryValue> api_features1(new base::DictionaryValue());
719 scoped_ptr<base::DictionaryValue> api_features2(new base::DictionaryValue()); 719 scoped_ptr<base::DictionaryValue> api_features2(new base::DictionaryValue());
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 extension.get(), 890 extension.get(),
891 Feature::BLESSED_EXTENSION_CONTEXT, 891 Feature::BLESSED_EXTENSION_CONTEXT,
892 GURL()).is_available()); 892 GURL()).is_available());
893 EXPECT_FALSE(extension_api->IsAvailable("pageAction", 893 EXPECT_FALSE(extension_api->IsAvailable("pageAction",
894 extension.get(), 894 extension.get(),
895 Feature::BLESSED_EXTENSION_CONTEXT, 895 Feature::BLESSED_EXTENSION_CONTEXT,
896 GURL()).is_available()); 896 GURL()).is_available());
897 } 897 }
898 898
899 } // namespace extensions 899 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/features/chrome_channel_feature_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698