diff options
author | jamescook <jamescook@chromium.org> | 2014-09-18 09:22:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-18 16:23:16 +0000 |
commit | a02b3e5b8ea70a6f362ef804ee552255b40a2c74 (patch) | |
tree | 42271e77fc8a9adf794bb1a1430b8ed924b92a76 /extensions | |
parent | ea8a6ef576c314506c4b3ee25544f6bcaa895fe1 (diff) | |
download | chromium_src-a02b3e5b8ea70a6f362ef804ee552255b40a2c74.zip chromium_src-a02b3e5b8ea70a6f362ef804ee552255b40a2c74.tar.gz chromium_src-a02b3e5b8ea70a6f362ef804ee552255b40a2c74.tar.bz2 |
Move extensions manifest tests to run in extensions_unittests
They don't need to run in Chrome's unit_tests suite.
* Move FileHandlersManifestTest
* Move ExternallyConnectableManifestTest
* Migrate some _manifest_features.json entries that should have been under
src/extensions a while ago.
BUG=397165
TEST=extensions_unittests, unit_tests
Review URL: https://codereview.chromium.org/565423003
Cr-Commit-Position: refs/heads/master@{#295479}
Diffstat (limited to 'extensions')
31 files changed, 651 insertions, 11 deletions
diff --git a/extensions/DEPS b/extensions/DEPS index 7cfd017..2286ed4 100644 --- a/extensions/DEPS +++ b/extensions/DEPS @@ -39,11 +39,7 @@ specific_include_rules = { "+chrome/browser/ui/browser.h", "+chrome/common/chrome_paths.h", "+chrome/common/extensions/features/feature_channel.h", - "+chrome/common/extensions/manifest_tests/chrome_manifest_test.h", "+chrome/test/base/testing_profile.h", "+chrome/test/base/ui_test_utils.h", ], - "(simple|complex)_feature_unittest\.cc|base_feature_provider_unittest\.cc": [ - "+chrome/common/extensions/features/chrome_channel_feature_filter.h", - ], } diff --git a/extensions/common/api/_manifest_features.json b/extensions/common/api/_manifest_features.json index 7d5290d..10cd833 100644 --- a/extensions/common/api/_manifest_features.json +++ b/extensions/common/api/_manifest_features.json @@ -70,6 +70,30 @@ "channel": "stable", "extension_types": "all" }, + "externally_connectable": { + "channel": "stable", + "extension_types": [ + "extension", "hosted_app", "legacy_packaged_app", "platform_app" + ] + }, + "file_handlers": [ + { + "channel": "stable", + "extension_types": ["platform_app"] + }, { + "channel": "stable", + "extension_types": [ "extension"], + "whitelist": [ + "2FC374607C2DF285634B67C64A2E356C607091C3", // Quickoffice + "3727DD3E564B6055387425027AD74C58784ACC15", // Quickoffice internal + "12E618C3C6E97495AAECF2AC12DEB082353241C6" // QO component extension + ] + } + ], + "icons": { + "channel": "stable", + "extension_types": "all" + }, "incognito": [ { "channel": "stable", @@ -93,6 +117,30 @@ "platform_app" ] }, + "launcher_page": { + "channel": "stable", + "min_manifest_version": 2, + "extension_types": ["platform_app"], + "whitelist": [ + "07BD6A765FFC289FF755D7CAB2893A40EC337FEC", // http://crbug.com/404000 + "896B85CC7E913E11C34892C1425A093C0701D386", // http://crbug.com/404000 + "11A01C82EF355E674E4F9728A801F5C3CB40D83F" // http://crbug.com/404000 + ] + }, + "manifest_version": { + "channel": "stable", + "extension_types": "all" + }, + "nacl_modules": { + "channel": "stable", + "extension_types": [ + "extension", "legacy_packaged_app", "hosted_app", "platform_app" + ] + }, + "name": { + "channel": "stable", + "extension_types": "all" + }, "offline_enabled": { "channel": "stable", "extension_types": [ @@ -114,6 +162,10 @@ "channel": "stable", "extension_types": ["platform_app"] }, + "version": { + "channel": "stable", + "extension_types": "all" + }, "web_accessible_resources": [ { "channel": "stable", diff --git a/extensions/common/common_manifest_handlers.cc b/extensions/common/common_manifest_handlers.cc index 1ce1637..37330ef 100644 --- a/extensions/common/common_manifest_handlers.cc +++ b/extensions/common/common_manifest_handlers.cc @@ -7,6 +7,7 @@ #include "extensions/common/manifest_handler.h" #include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/csp_info.h" +#include "extensions/common/manifest_handlers/externally_connectable.h" #include "extensions/common/manifest_handlers/file_handler_info.h" #include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/incognito_info.h" @@ -23,9 +24,11 @@ namespace extensions { void RegisterCommonManifestHandlers() { DCHECK(!ManifestHandler::IsRegistrationFinalized()); +#if defined(ENABLE_EXTENSIONS) (new BackgroundManifestHandler)->Register(); (new CSPHandler(false))->Register(); (new CSPHandler(true))->Register(); + (new ExternallyConnectableHandler)->Register(); (new FileHandlersParser)->Register(); (new IconsHandler)->Register(); (new IncognitoHandler)->Register(); @@ -39,6 +42,7 @@ void RegisterCommonManifestHandlers() { (new SharedModuleHandler)->Register(); (new WebAccessibleResourcesHandler)->Register(); (new WebviewHandler)->Register(); +#endif // defined(ENABLE_EXTENSIONS) } } // namespace extensions diff --git a/extensions/common/manifest_handlers/externally_connectable_unittest.cc b/extensions/common/manifest_handlers/externally_connectable_unittest.cc index 87e29cc..7064869 100644 --- a/extensions/common/manifest_handlers/externally_connectable_unittest.cc +++ b/extensions/common/manifest_handlers/externally_connectable_unittest.cc @@ -4,10 +4,10 @@ #include <algorithm> -#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" #include "extensions/common/error_utils.h" #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_handlers/externally_connectable.h" +#include "extensions/common/manifest_test.h" #include "extensions/common/permissions/permissions_data.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -18,8 +18,7 @@ namespace extensions { namespace errors = externally_connectable_errors; -// TODO(jamescook): Convert from ChromeManifestTest to ManifestTest. -class ExternallyConnectableTest : public ChromeManifestTest { +class ExternallyConnectableTest : public ManifestTest { public: ExternallyConnectableTest() {} virtual ~ExternallyConnectableTest() {} diff --git a/extensions/common/manifest_handlers/file_handler_manifest_unittest.cc b/extensions/common/manifest_handlers/file_handler_manifest_unittest.cc index f45d922..5934dc0 100644 --- a/extensions/common/manifest_handlers/file_handler_manifest_unittest.cc +++ b/extensions/common/manifest_handlers/file_handler_manifest_unittest.cc @@ -2,18 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_handlers/file_handler_info.h" +#include "extensions/common/manifest_test.h" #include "testing/gtest/include/gtest/gtest.h" namespace extensions { namespace errors = manifest_errors; -// TODO(jamescook): Convert from ChromeManifestTest to ManifestTest. -class FileHandlersManifestTest : public ChromeManifestTest { -}; +typedef ManifestTest FileHandlersManifestTest; TEST_F(FileHandlersManifestTest, InvalidFileHandlers) { Testcase testcases[] = { diff --git a/extensions/common/permissions/extensions_api_permissions.cc b/extensions/common/permissions/extensions_api_permissions.cc index b4b2ddf..efad143 100644 --- a/extensions/common/permissions/extensions_api_permissions.cc +++ b/extensions/common/permissions/extensions_api_permissions.cc @@ -4,6 +4,8 @@ #include "extensions/common/permissions/extensions_api_permissions.h" +#include <vector> + #include "extensions/common/permissions/api_permission.h" #include "extensions/common/permissions/permission_message.h" #include "extensions/common/permissions/socket_permission.h" @@ -65,6 +67,14 @@ std::vector<APIPermissionInfo*> ExtensionsAPIPermissions::GetAllPermissions() {APIPermission::kVideoCapture, "videoCapture", APIPermissionInfo::kFlagNone, IDS_EXTENSION_PROMPT_WARNING_VIDEO_CAPTURE, PermissionMessage::kVideoCapture}, + // NOTE(kalman): This is provided by a manifest property but needs to + // appear in the install permission dialogue, so we need a fake + // permission for it. See http://crbug.com/247857. + {APIPermission::kWebConnectable, "webConnectable", + APIPermissionInfo::kFlagCannotBeOptional | + APIPermissionInfo::kFlagInternal, + IDS_EXTENSION_PROMPT_WARNING_WEB_CONNECTABLE, + PermissionMessage::kWebConnectable}, {APIPermission::kWebView, "webview", APIPermissionInfo::kFlagCannotBeOptional}, {APIPermission::kWindowShape, "app.window.shape"}, diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp index c5a1e0c..9374ed8 100644 --- a/extensions/extensions.gyp +++ b/extensions/extensions.gyp @@ -1096,6 +1096,8 @@ 'common/features/complex_feature_unittest.cc', 'common/features/simple_feature_unittest.cc', 'common/manifest_handler_unittest.cc', + 'common/manifest_handlers/externally_connectable_unittest.cc', + 'common/manifest_handlers/file_handler_manifest_unittest.cc', 'common/manifest_handlers/shared_module_manifest_unittest.cc', 'common/message_bundle_unittest.cc', 'common/one_shot_event_unittest.cc', diff --git a/extensions/extensions_strings.grd b/extensions/extensions_strings.grd index 1e0af62..f6a73d2 100644 --- a/extensions/extensions_strings.grd +++ b/extensions/extensions_strings.grd @@ -349,6 +349,10 @@ <message name="IDS_EXTENSION_PROMPT_WARNING_U2F_DEVICES" desc="Warning message which indicates that an extension has access to Universal 2nd Factor devices."> Access your Universal 2nd Factor devices </message> + <message name="IDS_EXTENSION_PROMPT_WARNING_WEB_CONNECTABLE" desc="Permission string for allowing websites to connect to extensions."> + Communicate with cooperating websites + </message> + </messages> </release> </grit> diff --git a/extensions/test/data/manifest_tests/externally_connectable_all_ids.json b/extensions/test/data/manifest_tests/externally_connectable_all_ids.json new file mode 100644 index 0000000..cad1d9f --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_all_ids.json @@ -0,0 +1,12 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.AllIDs", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "ids": [ + "*", + "abcdefghijklmnopabcdefghijklmnop", + "ponmlkjihgfedcbaponmlkjihgfedcba" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_bad_id.json b/extensions/test/data/manifest_tests/externally_connectable_bad_id.json new file mode 100644 index 0000000..0510058 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_bad_id.json @@ -0,0 +1,13 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorBadID", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "ids": [ + "*", + "abcdefghijklmnopabcdefghijklmnop", + "badid", + "anotherbadid" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_all_urls.json b/extensions/test/data/manifest_tests/externally_connectable_error_all_urls.json new file mode 100644 index 0000000..027284f --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_all_urls.json @@ -0,0 +1,12 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorAllURLs", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "*://example.com/*", + "<all_urls>", + "http://build.chromium.org/*" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_bad_matches.json b/extensions/test/data/manifest_tests/externally_connectable_error_bad_matches.json new file mode 100644 index 0000000..fdc8cc8 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_bad_matches.json @@ -0,0 +1,14 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorBadMatches", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "http://example.com/", + "*://*.google.com/*", + "http://build.chromium.org/*", + "www.yahoo.com", + "httpz://*.yahoo.com/*" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_effective_tld.json b/extensions/test/data/manifest_tests/externally_connectable_error_effective_tld.json new file mode 100644 index 0000000..3deb88d --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_effective_tld.json @@ -0,0 +1,13 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorEffectiveTLD", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "*://example.com/*", + "http://*.appspot.com/*", + "http://build.chromium.org/*" + ] + } +} + diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_tld.json b/extensions/test/data/manifest_tests/externally_connectable_error_tld.json new file mode 100644 index 0000000..081cbf1 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_tld.json @@ -0,0 +1,12 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorTLD", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "*://example.com/*", + "http://*.co.uk/*", + "http://build.chromium.org/*" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_unknown_tld.json b/extensions/test/data/manifest_tests/externally_connectable_error_unknown_tld.json new file mode 100644 index 0000000..0d1bb61 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_unknown_tld.json @@ -0,0 +1,12 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorUnknownTLD", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "*://example.com/*", + "http://*.notatld/*", + "http://build.chromium.org/*" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_wildcard_host.json b/extensions/test/data/manifest_tests/externally_connectable_error_wildcard_host.json new file mode 100644 index 0000000..8814783 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_wildcard_host.json @@ -0,0 +1,12 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorWildcardHost", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "*://example.com/*", + "http://*/*", + "http://build.chromium.org/*" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_error_wrong_format.json b/extensions/test/data/manifest_tests/externally_connectable_error_wrong_format.json new file mode 100644 index 0000000..c100d74 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_error_wrong_format.json @@ -0,0 +1,6 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.ErrorWrongFormat", + "version": "1", + "manifest_version": 2, + "externally_connectable": "*" +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_ids.json b/extensions/test/data/manifest_tests/externally_connectable_ids.json new file mode 100644 index 0000000..95b252c --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_ids.json @@ -0,0 +1,11 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.IDs", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "ids": [ + "abcdefghijklmnopabcdefghijklmnop", + "ponmlkjihgfedcbaponmlkjihgfedcba" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_ids_and_matches.json b/extensions/test/data/manifest_tests/externally_connectable_ids_and_matches.json new file mode 100644 index 0000000..24652bf --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_ids_and_matches.json @@ -0,0 +1,20 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.IDsAndMatches", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "ids": [ + "abcdefghijklmnopabcdefghijklmnop", + "ponmlkjihgfedcbaponmlkjihgfedcba" + ], + "matches": [ + "http://example.com/", + "*://*.google.com/*", + "http://build.chromium.org/*", + "http://appspot.com/*", + "http://com/*", + "http://go/*", + "http://no.wildcard.path/" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_matches.json b/extensions/test/data/manifest_tests/externally_connectable_matches.json new file mode 100644 index 0000000..baf4e0f0 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_matches.json @@ -0,0 +1,12 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.Matches", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "http://example.com/", + "*://*.google.com/*", + "http://build.chromium.org/*" + ] + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_matches_tls_channel_id.json b/extensions/test/data/manifest_tests/externally_connectable_matches_tls_channel_id.json new file mode 100644 index 0000000..c6f0db9 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_matches_tls_channel_id.json @@ -0,0 +1,13 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.MatchesWithTlsChannelId", + "version": "1", + "manifest_version": 2, + "externally_connectable": { + "matches": [ + "http://example.com/", + "*://*.google.com/*", + "http://build.chromium.org/*" + ], + "accepts_tls_channel_id": true + } +} diff --git a/extensions/test/data/manifest_tests/externally_connectable_nothing_specified.json b/extensions/test/data/manifest_tests/externally_connectable_nothing_specified.json new file mode 100644 index 0000000..a6b5025 --- /dev/null +++ b/extensions/test/data/manifest_tests/externally_connectable_nothing_specified.json @@ -0,0 +1,6 @@ +{ + "name": "unit_tests --gtest_filter=ExternallyConnectableTest.NothingSpecified", + "version": "1", + "manifest_version": 2, + "externally_connectable": {} +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_extension.json b/extensions/test/data/manifest_tests/file_handlers_invalid_extension.json new file mode 100644 index 0000000..d2f705d --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_extension.json @@ -0,0 +1,25 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "types": [ + "text/*" + ], + "title": "Text editor" + }, + "image": { + "types": [ + "image/*" + ], + "extensions": "foo", + "title": "Image editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_extension_element.json b/extensions/test/data/manifest_tests/file_handlers_invalid_extension_element.json new file mode 100644 index 0000000..9834f70 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_extension_element.json @@ -0,0 +1,27 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "types": [ + "text/*" + ], + "title": "Text editor" + }, + "image": { + "types": [ + "image/*" + ], + "extensions": [ + [".png"] + ], + "title": "Image editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_handlers.json b/extensions/test/data/manifest_tests/file_handlers_invalid_handlers.json new file mode 100644 index 0000000..f1d65d1 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_handlers.json @@ -0,0 +1,11 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": [] +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_no_type_or_extension.json b/extensions/test/data/manifest_tests/file_handlers_invalid_no_type_or_extension.json new file mode 100644 index 0000000..777c966 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_no_type_or_extension.json @@ -0,0 +1,15 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "title": "Text editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_not_app.json b/extensions/test/data/manifest_tests/file_handlers_invalid_not_app.json new file mode 100644 index 0000000..a4f6d34 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_not_app.json @@ -0,0 +1,23 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "file_handlers": { + "text": { + "types": [ + "text/*" + ], + "title": "Text editor" + }, + "image": { + "types": [ + "image/*" + ], + "extensions": [ + ".png", + ".gif" + ], + "title": "Image editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_too_many.json b/extensions/test/data/manifest_tests/file_handlers_invalid_too_many.json new file mode 100644 index 0000000..8a47d03 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_too_many.json @@ -0,0 +1,226 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "types": [ + "00/*", + "01/*", + "02/*", + "03/*", + "04/*", + "05/*", + "06/*", + "07/*", + "08/*", + "09/*", + "10/*", + "11/*", + "12/*", + "13/*", + "14/*", + "15/*", + "16/*", + "17/*", + "18/*", + "19/*", + "20/*", + "21/*", + "22/*", + "23/*", + "24/*", + "25/*", + "26/*", + "27/*", + "28/*", + "29/*", + "30/*", + "31/*", + "32/*", + "33/*", + "34/*", + "35/*", + "36/*", + "37/*", + "38/*", + "39/*", + "40/*", + "41/*", + "42/*", + "43/*", + "44/*", + "45/*", + "46/*", + "47/*", + "48/*", + "49/*", + "50/*", + "51/*", + "52/*", + "53/*", + "54/*", + "55/*", + "56/*", + "57/*", + "58/*", + "59/*", + "60/*", + "61/*", + "62/*", + "63/*", + "64/*", + "65/*", + "66/*", + "67/*", + "68/*", + "69/*", + "70/*", + "71/*", + "72/*", + "73/*", + "74/*", + "75/*", + "76/*", + "77/*", + "78/*", + "79/*", + "80/*", + "81/*", + "82/*", + "83/*", + "84/*", + "85/*", + "86/*", + "87/*", + "88/*", + "89/*", + "90/*", + "91/*", + "92/*", + "93/*", + "94/*", + "95/*", + "96/*", + "97/*", + "98/*", + "99/*" + ], + "title": "Text editor" + }, + "image": { + "types": [ + "00/*", + "01/*", + "02/*", + "03/*", + "04/*", + "05/*", + "06/*", + "07/*", + "08/*", + "09/*", + "10/*", + "11/*", + "12/*", + "13/*", + "14/*", + "15/*", + "16/*", + "17/*", + "18/*", + "19/*", + "20/*", + "21/*", + "22/*", + "23/*", + "24/*", + "25/*", + "26/*", + "27/*", + "28/*", + "29/*", + "30/*", + "31/*", + "32/*", + "33/*", + "34/*", + "35/*", + "36/*", + "37/*", + "38/*", + "39/*", + "40/*", + "41/*", + "42/*", + "43/*", + "44/*", + "45/*", + "46/*", + "47/*", + "48/*", + "49/*", + "50/*", + "51/*", + "52/*", + "53/*", + "54/*", + "55/*", + "56/*", + "57/*", + "58/*", + "59/*", + "60/*", + "61/*", + "62/*", + "63/*", + "64/*", + "65/*", + "66/*", + "67/*", + "68/*", + "69/*", + "70/*", + "71/*", + "72/*", + "73/*", + "74/*", + "75/*", + "76/*", + "77/*", + "78/*", + "79/*", + "80/*", + "81/*", + "82/*", + "83/*", + "84/*", + "85/*", + "86/*", + "87/*", + "88/*", + "89/*", + "90/*", + "91/*", + "92/*", + "93/*", + "94/*", + "95/*", + "96/*", + "97/*", + "98/*", + "99/*" + ], + "extensions": [ + ".png", + ".gif" + ], + "title": "Image editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_type.json b/extensions/test/data/manifest_tests/file_handlers_invalid_type.json new file mode 100644 index 0000000..d51caa94 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_type.json @@ -0,0 +1,26 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "types": [ + "text/*" + ], + "title": "Text editor" + }, + "image": { + "types": "bar", + "extensions": [ + ".png", + ".gif" + ], + "title": "Image editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_invalid_type_element.json b/extensions/test/data/manifest_tests/file_handlers_invalid_type_element.json new file mode 100644 index 0000000..0714290 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_invalid_type_element.json @@ -0,0 +1,28 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "types": [ + 42 + ], + "title": "Text editor" + }, + "image": { + "types": [ + "image/*" + ], + "extensions": [ + ".png", + ".gif" + ], + "title": "Image editor" + } + } +} diff --git a/extensions/test/data/manifest_tests/file_handlers_valid.json b/extensions/test/data/manifest_tests/file_handlers_valid.json new file mode 100644 index 0000000..d943091 --- /dev/null +++ b/extensions/test/data/manifest_tests/file_handlers_valid.json @@ -0,0 +1,26 @@ +{ + "name": "test", + "description": "App with file_handlers manifest.", + "version": "1", + "app": { + "background": { + "scripts": ["background.js"] + } + }, + "file_handlers": { + "text": { + "types": [ + "text/*" + ] + }, + "image": { + "types": [ + "image/*" + ], + "extensions": [ + ".png", + ".gif" + ] + } + } +} |