| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 // TODO(aa): More stuff to test over time. | 659 // TODO(aa): More stuff to test over time. |
| 660 } test_data[] = { | 660 } test_data[] = { |
| 661 { bookmarks }, | 661 { bookmarks }, |
| 662 { bookmarks_create } | 662 { bookmarks_create } |
| 663 }; | 663 }; |
| 664 | 664 |
| 665 for (size_t i = 0; i < arraysize(test_data); ++i) { | 665 for (size_t i = 0; i < arraysize(test_data); ++i) { |
| 666 SimpleFeature* feature = test_data[i].feature; | 666 SimpleFeature* feature = test_data[i].feature; |
| 667 ASSERT_TRUE(feature) << i; | 667 ASSERT_TRUE(feature) << i; |
| 668 | 668 |
| 669 EXPECT_TRUE(feature->whitelist()->empty()); | 669 EXPECT_TRUE(feature->whitelist().empty()); |
| 670 EXPECT_TRUE(feature->extension_types()->empty()); | 670 EXPECT_TRUE(feature->extension_types().empty()); |
| 671 | 671 |
| 672 EXPECT_EQ(SimpleFeature::UNSPECIFIED_LOCATION, feature->location()); | 672 EXPECT_EQ(SimpleFeature::UNSPECIFIED_LOCATION, feature->location()); |
| 673 EXPECT_TRUE(feature->platforms()->empty()); | 673 EXPECT_TRUE(feature->platforms().empty()); |
| 674 EXPECT_EQ(0, feature->min_manifest_version()); | 674 EXPECT_EQ(0, feature->min_manifest_version()); |
| 675 EXPECT_EQ(0, feature->max_manifest_version()); | 675 EXPECT_EQ(0, feature->max_manifest_version()); |
| 676 } | 676 } |
| 677 } | 677 } |
| 678 | 678 |
| 679 TEST(ExtensionAPITest, FeaturesRequireContexts) { | 679 TEST(ExtensionAPITest, FeaturesRequireContexts) { |
| 680 // TODO(cduvall): Make this check API featues. | 680 // TODO(cduvall): Make this check API featues. |
| 681 std::unique_ptr<base::DictionaryValue> api_features1( | 681 std::unique_ptr<base::DictionaryValue> api_features1( |
| 682 new base::DictionaryValue()); | 682 new base::DictionaryValue()); |
| 683 std::unique_ptr<base::DictionaryValue> api_features2( | 683 std::unique_ptr<base::DictionaryValue> api_features2( |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 extension.get(), | 855 extension.get(), |
| 856 Feature::BLESSED_EXTENSION_CONTEXT, | 856 Feature::BLESSED_EXTENSION_CONTEXT, |
| 857 GURL()).is_available()); | 857 GURL()).is_available()); |
| 858 EXPECT_FALSE(extension_api->IsAvailable("pageAction", | 858 EXPECT_FALSE(extension_api->IsAvailable("pageAction", |
| 859 extension.get(), | 859 extension.get(), |
| 860 Feature::BLESSED_EXTENSION_CONTEXT, | 860 Feature::BLESSED_EXTENSION_CONTEXT, |
| 861 GURL()).is_available()); | 861 GURL()).is_available()); |
| 862 } | 862 } |
| 863 | 863 |
| 864 } // namespace extensions | 864 } // namespace extensions |
| OLD | NEW |