OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |