| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 &child_name); | 674 &child_name); |
| 675 EXPECT_EQ(test_data[i].api_name, api_name) << test_data[i].input; | 675 EXPECT_EQ(test_data[i].api_name, api_name) << test_data[i].input; |
| 676 EXPECT_EQ(test_data[i].child_name, child_name) << test_data[i].input; | 676 EXPECT_EQ(test_data[i].child_name, child_name) << test_data[i].input; |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 | 679 |
| 680 TEST(ExtensionAPITest, DefaultConfigurationFeatures) { | 680 TEST(ExtensionAPITest, DefaultConfigurationFeatures) { |
| 681 std::unique_ptr<ExtensionAPI> api( | 681 std::unique_ptr<ExtensionAPI> api( |
| 682 ExtensionAPI::CreateWithDefaultConfiguration()); | 682 ExtensionAPI::CreateWithDefaultConfiguration()); |
| 683 | 683 |
| 684 SimpleFeature* bookmarks = static_cast<SimpleFeature*>( | 684 SimpleFeature* browser_action = static_cast<SimpleFeature*>( |
| 685 api->GetFeatureDependency("api:bookmarks")); | 685 api->GetFeatureDependency("api:browserAction")); |
| 686 SimpleFeature* bookmarks_create = static_cast<SimpleFeature*>( | 686 SimpleFeature* browser_action_set_title = static_cast<SimpleFeature*>( |
| 687 api->GetFeatureDependency("api:bookmarks.create")); | 687 api->GetFeatureDependency("api:browserAction.setTitle")); |
| 688 | 688 |
| 689 struct { | 689 struct { |
| 690 SimpleFeature* feature; | 690 SimpleFeature* feature; |
| 691 // TODO(aa): More stuff to test over time. | 691 // TODO(aa): More stuff to test over time. |
| 692 } test_data[] = { | 692 } test_data[] = {{browser_action}, {browser_action_set_title}}; |
| 693 { bookmarks }, | |
| 694 { bookmarks_create } | |
| 695 }; | |
| 696 | 693 |
| 697 for (size_t i = 0; i < arraysize(test_data); ++i) { | 694 for (size_t i = 0; i < arraysize(test_data); ++i) { |
| 698 SimpleFeature* feature = test_data[i].feature; | 695 SimpleFeature* feature = test_data[i].feature; |
| 699 ASSERT_TRUE(feature) << i; | 696 ASSERT_TRUE(feature) << i; |
| 700 | 697 |
| 701 EXPECT_TRUE(feature->whitelist().empty()); | 698 EXPECT_TRUE(feature->whitelist().empty()); |
| 702 EXPECT_TRUE(feature->extension_types().empty()); | 699 EXPECT_TRUE(feature->extension_types().empty()); |
| 703 | 700 |
| 704 EXPECT_EQ(SimpleFeature::UNSPECIFIED_LOCATION, feature->location()); | 701 EXPECT_EQ(SimpleFeature::UNSPECIFIED_LOCATION, feature->location()); |
| 705 EXPECT_TRUE(feature->platforms().empty()); | 702 EXPECT_TRUE(feature->platforms().empty()); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 extension.get(), | 872 extension.get(), |
| 876 Feature::BLESSED_EXTENSION_CONTEXT, | 873 Feature::BLESSED_EXTENSION_CONTEXT, |
| 877 GURL()).is_available()); | 874 GURL()).is_available()); |
| 878 EXPECT_FALSE(extension_api->IsAvailable("pageAction", | 875 EXPECT_FALSE(extension_api->IsAvailable("pageAction", |
| 879 extension.get(), | 876 extension.get(), |
| 880 Feature::BLESSED_EXTENSION_CONTEXT, | 877 Feature::BLESSED_EXTENSION_CONTEXT, |
| 881 GURL()).is_available()); | 878 GURL()).is_available()); |
| 882 } | 879 } |
| 883 | 880 |
| 884 } // namespace extensions | 881 } // namespace extensions |
| OLD | NEW |