summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-08 05:45:03 +0000
committermihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-08 05:45:03 +0000
commit75603853c16eccdbeaff563e2d78270df3d0a640 (patch)
tree76f32ffabb2189c30caa686523624d7c48819634
parentaf5e62c35a97eec03b64701aa31024b8c139b836 (diff)
downloadchromium_src-75603853c16eccdbeaff563e2d78270df3d0a640.zip
chromium_src-75603853c16eccdbeaff563e2d78270df3d0a640.tar.gz
chromium_src-75603853c16eccdbeaff563e2d78270df3d0a640.tar.bz2
Change the platform app manifest structure.
Instead of an explicit "platform_app": true manifest keys, platform apps are now defined by the presence of the "background" section inside "app" (since platform apps require background pages). The top-level "background" section is not supported for platform apps. R=miket@chromium.org BUG=131394 Review URL: https://chromiumcodereview.appspot.com/10544059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141177 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/api/_manifest_features.json15
-rw-r--r--chrome/common/extensions/docs/build/directory.py6
-rw-r--r--chrome/common/extensions/docs/examples/extensions/calculator/main.js4
-rw-r--r--chrome/common/extensions/docs/examples/extensions/calculator/manifest.json9
-rw-r--r--chrome/common/extensions/docs/samples.html10
-rw-r--r--chrome/common/extensions/docs/samples.json13
-rw-r--r--chrome/common/extensions/extension.cc59
-rw-r--r--chrome/common/extensions/extension.h4
-rw-r--r--chrome/common/extensions/extension_manifest_constants.cc4
-rw-r--r--chrome/common/extensions/extension_manifest_constants.h4
-rw-r--r--chrome/common/extensions/manifest.cc25
-rw-r--r--chrome/common/extensions/manifest.h1
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifest_test.cc33
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifest_test.h24
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc8
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc43
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc21
-rw-r--r--chrome/common/extensions/manifest_unittest.cc24
-rw-r--r--chrome/test/data/extensions/allow_silent_upgrade/scopes1_new.json5
-rw-r--r--chrome/test/data/extensions/allow_silent_upgrade/scopes1_old.json5
-rw-r--r--chrome/test/data/extensions/allow_silent_upgrade/scopes2_new.json5
-rw-r--r--chrome/test/data/extensions/allow_silent_upgrade/scopes2_old.json5
-rw-r--r--chrome/test/data/extensions/allow_silent_upgrade/scopes3_new.json5
-rw-r--r--chrome/test/data/extensions/allow_silent_upgrade/scopes3_old.json5
-rw-r--r--chrome/test/data/extensions/api_test/dns/api/manifest.json7
-rw-r--r--chrome/test/data/extensions/api_test/identity/manifest.json5
-rw-r--r--chrome/test/data/extensions/api_test/serial/api/manifest.json7
-rw-r--r--chrome/test/data/extensions/api_test/socket/api/manifest.json7
-rw-r--r--chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_1.json7
-rw-r--r--chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_2.json7
-rw-r--r--chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_3.json7
-rw-r--r--chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_4.json14
-rw-r--r--chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_5.json14
-rw-r--r--chrome/test/data/extensions/manifest_tests/init_valid_platform_app.json7
-rw-r--r--chrome/test/data/extensions/manifest_tests/sandboxed_pages_invalid_5.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/context_menu/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/get_display_path/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/iframes/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/isolation/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch_file/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch_invalid/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch_no_intent/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch_nothing/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch_wrong_intent/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/launch_wrong_type/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/minimal/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/navigation/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/restrictions/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/storage/manifest.json7
-rw-r--r--chrome/test/data/extensions/platform_apps/windows_api/manifest.json7
51 files changed, 333 insertions, 205 deletions
diff --git a/chrome/common/extensions/api/_manifest_features.json b/chrome/common/extensions/api/_manifest_features.json
index e6b6547..eaae3d1 100644
--- a/chrome/common/extensions/api/_manifest_features.json
+++ b/chrome/common/extensions/api/_manifest_features.json
@@ -7,6 +7,11 @@
"channel": "stable",
"extension_types": ["packaged_app", "hosted_app", "platform_app"]
},
+ "app.background": {
+ "channel": "stable",
+ "extension_types": ["platform_app"],
+ "min_manifest_version": 2
+ },
"app.launch": {
"channel": "stable",
"extension_types": ["packaged_app", "hosted_app"]
@@ -20,7 +25,8 @@
"background": {
"channel": "stable",
"extension_types": [
- "extension", "packaged_app", "hosted_app", "platform_app"
+ // Platform apps specify their background page via app.background.
+ "extension", "packaged_app", "hosted_app"
]
},
"background.persistent": {
@@ -33,7 +39,7 @@
"background_page": {
"channel": "stable",
"extension_types": [
- "extension", "packaged_app", "hosted_app", "platform_app"
+ "extension", "packaged_app", "hosted_app"
],
"max_manifest_version": 1
},
@@ -176,11 +182,6 @@
"extension", "packaged_app", "hosted_app", "platform_app"
]
},
- "platform_app": {
- "channel": "stable",
- "extension_types": ["platform_app"],
- "min_manifest_version": 2
- },
"plugins": {
"channel": "stable",
"extension_types": ["extension", "packaged_app", "hosted_app"]
diff --git a/chrome/common/extensions/docs/build/directory.py b/chrome/common/extensions/docs/build/directory.py
index 9e2627e..b7522f0 100644
--- a/chrome/common/extensions/docs/build/directory.py
+++ b/chrome/common/extensions/docs/build/directory.py
@@ -749,10 +749,12 @@ class Sample(dict):
return has_b_popup or has_p_popup
def is_hosted_app(self):
- """ Returns true if the manifest has an app but not a local_path."""
+ """ Returns true if the manifest has an app but not a local_path (that's a
+ packaged app) nor a background (that's a platform app)."""
return (self._manifest.has_key('app') and
(not self._manifest['app'].has_key('launch') or
- not self._manifest['app']['launch'].has_key('local_path')))
+ not self._manifest['app']['launch'].has_key('local_path')) and
+ not self._manifest['app'].has_key('background'))
def is_packaged_app(self):
""" Returns true if the manifest has an app/launch/local_path section."""
diff --git a/chrome/common/extensions/docs/examples/extensions/calculator/main.js b/chrome/common/extensions/docs/examples/extensions/calculator/main.js
index 4260e09..982d326 100644
--- a/chrome/common/extensions/docs/examples/extensions/calculator/main.js
+++ b/chrome/common/extensions/docs/examples/extensions/calculator/main.js
@@ -3,9 +3,7 @@
// found in the LICENSE file.
chrome.experimental.app.onLaunched.addListener(function() {
- chrome.windows.create({
- url: 'calculator.html',
- type: 'shell',
+ chrome.appWindow.create('calculator.html', {
width: 217,
height: 223
});
diff --git a/chrome/common/extensions/docs/examples/extensions/calculator/manifest.json b/chrome/common/extensions/docs/examples/extensions/calculator/manifest.json
index 55917a3..4019db9 100644
--- a/chrome/common/extensions/docs/examples/extensions/calculator/manifest.json
+++ b/chrome/common/extensions/docs/examples/extensions/calculator/manifest.json
@@ -3,16 +3,17 @@
"description": "Add numbers. Now includes subtraction!",
"manifest_version": 2,
"version": "1.0.1",
- "background": {
- "scripts": ["main.js"]
+ "app": {
+ "background": {
+ "scripts": ["main.js"]
+ }
},
- "platform_app": true,
"icons": {
"16": "icon_16.png",
"128": "icon_128.png"
},
"permissions": [
"experimental",
- "windows"
+ "appWindow"
]
}
diff --git a/chrome/common/extensions/docs/samples.html b/chrome/common/extensions/docs/samples.html
index 60aff22..218fd28 100644
--- a/chrome/common/extensions/docs/samples.html
+++ b/chrome/common/extensions/docs/samples.html
@@ -204,7 +204,7 @@
"7da105f28e200d42510aff3591dfa5aeb0b82605": "BLOCK/ALLOW THIRD-PARTY COOKIES API EXAMPLE EXTENSION SAMPLE EXTENSION WHICH DEMONSTRATES HOW TO ACCESS A PREFERENCE. BROWSER_ACTION PRIVACY CHROME.EXTENSION.ISALLOWEDINCOGNITOACCESS",
"9004d1a1b975859d07bdff94ea0a4baa106c4fd1": "BROKEN LINKS EXTENDS THE DEVELOPER TOOLS, ADDING AN AUDIT CATEGORY THAT FINDS BROKEN LINKS ON THE INSPECTED PAGE. BACKGROUND_PAGE DEVTOOLS_PAGE EXPERIMENTAL TABS CHROME.EXPERIMENTAL.DEVTOOLS.AUDITS.ADDCATEGORY CHROME.TABS.EXECUTESCRIPT",
"e7e4284e3b5484b0c1eae7f724768945ad0121e4": "BROWSINGDATA API: BASICS A TRIVIAL USAGE EXAMPLE. BROWSER_ACTION BROWSINGDATA POPUP CHROME.BROWSINGDATA.REMOVE",
- "3fb3045783163c0eaaf0d0ce139f254502192a92": "CALCULATOR (PLATFORM APP) ADD NUMBERS. NOW INCLUDES SUBTRACTION! BACKGROUND_PAGE EXPERIMENTAL WINDOWS CHROME.WINDOWS.CREATE",
+ "3fb3045783163c0eaaf0d0ce139f254502192a92": "CALCULATOR (PLATFORM APP) ADD NUMBERS. NOW INCLUDES SUBTRACTION! APPWINDOW EXPERIMENTAL CHROME.APPWINDOW.CREATE",
"7f4d3fac7ae1ad4d514a15cd0b2c48c57a58c55e": "CATBLOCK I CANT HAS CHEEZBURGER! BACKGROUND_PAGE WEBREQUEST WEBREQUESTBLOCKING CHROME.WEBREQUEST.ONBEFOREREQUEST",
"924f75a201bb0ec8d6c0b1c9c88c679ea211c93d": "CHROME QUERY EXTENDS THE DEVELOPER TOOLS, ADDING A SIDEBAR THAT DISPLAYS THE JQUERY DATA ASSOCIATED WITH THE SELECTED DOM ELEMENT. DEVTOOLS_PAGE",
"903e7277139e1e6caec123d3319cab295d8d1b3a": "CHROME SOUNDS ENJOY A MORE MAGICAL AND IMMERSIVE EXPERIENCE WHEN BROWSING THE WEB USING THE POWER OF SOUND. BACKGROUND_PAGE BOOKMARKS OPTIONS_PAGE TABS CHROME.BOOKMARKS.ONCREATED CHROME.BOOKMARKS.ONMOVED CHROME.BOOKMARKS.ONREMOVED CHROME.EXTENSION.GETBACKGROUNDPAGE CHROME.TABS.GET CHROME.TABS.ONATTACHED CHROME.TABS.ONCREATED CHROME.TABS.ONDETACHED CHROME.TABS.ONMOVED CHROME.TABS.ONREMOVED CHROME.TABS.ONUPDATED CHROME.WINDOWS.ONCREATED CHROME.WINDOWS.ONFOCUSCHANGED CHROME.WINDOWS.ONREMOVED",
@@ -791,19 +791,17 @@
</h2>
<p class="metadata features">Uses
<span>
- <strong>background_page</strong><span>, </span>
- </span><span>
- <strong>experimental</strong>
+ <strong>appWindow</strong>
<span> and</span>
</span><span>
- <strong>windows</strong>
+ <strong>experimental</strong>
</span>
</p>
<p>Add numbers. Now includes subtraction!</p>
<div class="apicalls"><strong>Calls:</strong>
<ul>
<li>
- <code><a href="windows.html#method-create">chrome.windows.create</a></code>
+ <code><a href="appWindow.html#method-create">chrome.appWindow.create</a></code>
</li>
</ul>
</div>
diff --git a/chrome/common/extensions/docs/samples.json b/chrome/common/extensions/docs/samples.json
index 18375ca..6281eb2 100644
--- a/chrome/common/extensions/docs/samples.json
+++ b/chrome/common/extensions/docs/samples.json
@@ -675,14 +675,13 @@
},
{
"api_calls": [
- "chrome.windows.create"
+ "chrome.appWindow.create"
],
"crx_path": null,
"description": "Add numbers. Now includes subtraction!",
"features": [
- "background_page",
- "experimental",
- "windows"
+ "appWindow",
+ "experimental"
],
"icon": "icon_128.png",
"id": "3fb3045783163c0eaaf0d0ce139f254502192a92",
@@ -690,7 +689,7 @@
"packaged_app": false,
"path": "examples/extensions/calculator/",
"protocols": [],
- "search_string": "CALCULATOR (PLATFORM APP) ADD NUMBERS. NOW INCLUDES SUBTRACTION! BACKGROUND_PAGE EXPERIMENTAL WINDOWS CHROME.WINDOWS.CREATE",
+ "search_string": "CALCULATOR (PLATFORM APP) ADD NUMBERS. NOW INCLUDES SUBTRACTION! APPWINDOW EXPERIMENTAL CHROME.APPWINDOW.CREATE",
"source_files": [
"calculator.html",
"controller.js",
@@ -701,7 +700,7 @@
"style.css",
"view.js"
],
- "source_hash": "e7718b346a126dd6511553b51056b53732f664cf",
+ "source_hash": "9ffcc4ae67840e1ac102c0dd1922dac92e6bf3f8",
"zip_path": "examples/extensions/calculator.zip"
},
{
@@ -2805,4 +2804,4 @@
"zip_path": "examples/api/extension/isAllowedAccess.zip"
}
]
-} \ No newline at end of file
+}
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index a06497e..6216fdd 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1593,9 +1593,7 @@ bool Extension::LoadWebAccessibleResources(string16* error) {
}
bool Extension::LoadSandboxedPages(string16* error) {
- // Can't use HasKey, since it doesn't do path expansion.
- Value* ignored = NULL;
- if (!manifest_->Get(keys::kSandboxedPages, &ignored))
+ if (!manifest_->HasPath(keys::kSandboxedPages))
return true;
ListValue* list_value = NULL;
@@ -1615,7 +1613,7 @@ bool Extension::LoadSandboxedPages(string16* error) {
sandboxed_pages_.insert(relative_path);
}
- if (manifest_->Get(keys::kSandboxedPagesCSP, &ignored)) {
+ if (manifest_->HasPath(keys::kSandboxedPagesCSP)) {
if (!manifest_->GetString(
keys::kSandboxedPagesCSP, &sandboxed_pages_content_security_policy_)) {
*error = ASCIIToUTF16(errors::kInvalidSandboxedPagesCSP);
@@ -1719,8 +1717,16 @@ bool Extension::LoadOptionsPage(string16* error) {
}
bool Extension::LoadBackgroundScripts(string16* error) {
+ if (is_platform_app()) {
+ return LoadBackgroundScripts(keys::kPlatformAppBackgroundScripts, error);
+ }
+
+ return LoadBackgroundScripts(keys::kBackgroundScripts, error);
+}
+
+bool Extension::LoadBackgroundScripts(const std::string& key, string16* error) {
Value* background_scripts_value = NULL;
- if (!manifest_->Get(keys::kBackgroundScripts, &background_scripts_value))
+ if (!manifest_->Get(key, &background_scripts_value))
return true;
CHECK(background_scripts_value);
@@ -1747,45 +1753,60 @@ bool Extension::LoadBackgroundScripts(string16* error) {
bool Extension::LoadBackgroundPage(
const ExtensionAPIPermissionSet& api_permissions,
string16* error) {
- base::Value* background_page_value = NULL;
- if (!manifest_->Get(keys::kBackgroundPage, &background_page_value))
- manifest_->Get(keys::kBackgroundPageLegacy, &background_page_value);
+ if (is_platform_app()) {
+ return LoadBackgroundPage(
+ keys::kPlatformAppBackgroundPage, api_permissions, error);
+ }
- if (!background_page_value)
+ if (!LoadBackgroundPage(keys::kBackgroundPage, api_permissions, error))
+ return false;
+ if (background_url_.is_empty())
+ return LoadBackgroundPage(
+ keys::kBackgroundPageLegacy, api_permissions, error);
+ return true;
+}
+
+bool Extension::LoadBackgroundPage(
+ const std::string& key,
+ const ExtensionAPIPermissionSet& api_permissions,
+ string16* error) {
+ base::Value* background_page_value = NULL;
+ if (!manifest_->Get(key, &background_page_value))
return true;
- std::string background_str;
- if (!background_page_value->GetAsString(&background_str)) {
- *error = ASCIIToUTF16(errors::kInvalidBackground);
+ if (!background_scripts_.empty()) {
+ *error = ASCIIToUTF16(errors::kInvalidBackgroundCombination);
return false;
}
- if (!background_scripts_.empty()) {
- *error = ASCIIToUTF16(errors::kInvalidBackgroundCombination);
+
+ std::string background_str;
+ if (!background_page_value->GetAsString(&background_str)) {
+ *error = ASCIIToUTF16(errors::kInvalidBackground);
return false;
}
if (is_hosted_app()) {
+ background_url_ = GURL(background_str);
+
// Make sure "background" permission is set.
if (!api_permissions.count(ExtensionAPIPermission::kBackground)) {
*error = ASCIIToUTF16(errors::kBackgroundPermissionNeeded);
return false;
}
// Hosted apps require an absolute URL.
- GURL bg_page(background_str);
- if (!bg_page.is_valid()) {
+ if (!background_url_.is_valid()) {
*error = ASCIIToUTF16(errors::kInvalidBackgroundInHostedApp);
return false;
}
- if (!(bg_page.SchemeIs("https") ||
+ if (!(background_url_.SchemeIs("https") ||
(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowHTTPBackgroundPage) &&
- bg_page.SchemeIs("http")))) {
+ background_url_.SchemeIs("http")))) {
*error = ASCIIToUTF16(errors::kInvalidBackgroundInHostedApp);
return false;
}
- background_url_ = bg_page;
} else {
background_url_ = GetResourceURL(background_str);
}
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 9713fd8..6fac262 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -753,8 +753,12 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
bool LoadOfflineEnabled(string16* error);
bool LoadOptionsPage(string16* error);
bool LoadBackgroundScripts(string16* error);
+ bool LoadBackgroundScripts(const std::string& key, string16* error);
bool LoadBackgroundPage(const ExtensionAPIPermissionSet& api_permissions,
string16* error);
+ bool LoadBackgroundPage(const std::string& key,
+ const ExtensionAPIPermissionSet& api_permissions,
+ string16* error);
bool LoadBackgroundPersistent(
const ExtensionAPIPermissionSet& api_permissions,
string16* error);
diff --git a/chrome/common/extensions/extension_manifest_constants.cc b/chrome/common/extensions/extension_manifest_constants.cc
index e1308e4..91a4259 100644
--- a/chrome/common/extensions/extension_manifest_constants.cc
+++ b/chrome/common/extensions/extension_manifest_constants.cc
@@ -85,7 +85,9 @@ const char kPageActionPopup[] = "popup";
const char kPageActionPopupPath[] = "path";
const char kPageActions[] = "page_actions";
const char kPermissions[] = "permissions";
-const char kPlatformApp[] = "platform_app";
+const char kPlatformAppBackground[] = "app.background";
+const char kPlatformAppBackgroundPage[] = "app.background.page";
+const char kPlatformAppBackgroundScripts[] = "app.background.scripts";
const char kPlugins[] = "plugins";
const char kPluginsPath[] = "path";
const char kPluginsPublic[] = "public";
diff --git a/chrome/common/extensions/extension_manifest_constants.h b/chrome/common/extensions/extension_manifest_constants.h
index bb285f4..8dbeaa3 100644
--- a/chrome/common/extensions/extension_manifest_constants.h
+++ b/chrome/common/extensions/extension_manifest_constants.h
@@ -93,7 +93,9 @@ namespace extension_manifest_keys {
extern const char kPageActionPopupPath[];
extern const char kPageActions[];
extern const char kPermissions[];
- extern const char kPlatformApp[];
+ extern const char kPlatformAppBackground[];
+ extern const char kPlatformAppBackgroundPage[];
+ extern const char kPlatformAppBackgroundScripts[];
extern const char kPlugins[];
extern const char kPluginsPath[];
extern const char kPluginsPublic[];
diff --git a/chrome/common/extensions/manifest.cc b/chrome/common/extensions/manifest.cc
index fa3658b..f7bcbab 100644
--- a/chrome/common/extensions/manifest.cc
+++ b/chrome/common/extensions/manifest.cc
@@ -26,21 +26,17 @@ Manifest::Manifest(Extension::Location location,
type_(Extension::TYPE_UNKNOWN) {
if (value_->HasKey(keys::kTheme)) {
type_ = Extension::TYPE_THEME;
- } else {
- bool is_platform_app = false;
- if (value_->GetBoolean(keys::kPlatformApp, &is_platform_app) &&
- is_platform_app) {
+ } else if (value_->HasKey(keys::kApp)) {
+ if (value_->Get(keys::kWebURLs, NULL) ||
+ value_->Get(keys::kLaunchWebURL, NULL)) {
+ type_ = Extension::TYPE_HOSTED_APP;
+ } else if (value_->Get(keys::kPlatformAppBackground, NULL)) {
type_ = Extension::TYPE_PLATFORM_APP;
- } else if (value_->HasKey(keys::kApp)) {
- if (value_->Get(keys::kWebURLs, NULL) ||
- value_->Get(keys::kLaunchWebURL, NULL)) {
- type_ = Extension::TYPE_HOSTED_APP;
- } else {
- type_ = Extension::TYPE_PACKAGED_APP;
- }
} else {
- type_ = Extension::TYPE_EXTENSION;
+ type_ = Extension::TYPE_PACKAGED_APP;
}
+ } else {
+ type_ = Extension::TYPE_EXTENSION;
}
CHECK_NE(type_, Extension::TYPE_UNKNOWN);
}
@@ -93,6 +89,11 @@ bool Manifest::HasKey(const std::string& key) const {
return CanAccessKey(key) && value_->HasKey(key);
}
+bool Manifest::HasPath(const std::string& path) const {
+ Value* ignored = NULL;
+ return CanAccessPath(path) && value_->Get(path, &ignored);
+}
+
bool Manifest::Get(
const std::string& path, Value** out_value) const {
return CanAccessPath(path) && value_->Get(path, out_value);
diff --git a/chrome/common/extensions/manifest.h b/chrome/common/extensions/manifest.h
index 5ae2a1d..3e82f38 100644
--- a/chrome/common/extensions/manifest.h
+++ b/chrome/common/extensions/manifest.h
@@ -52,6 +52,7 @@ class Manifest {
// These access the wrapped manifest value, returning false when the property
// does not exist or if the manifest type can't access it.
bool HasKey(const std::string& key) const;
+ bool HasPath(const std::string& path) const;
bool Get(const std::string& path, base::Value** out_value) const;
bool GetBoolean(const std::string& path, bool* out_value) const;
bool GetInteger(const std::string& path, int* out_value) const;
diff --git a/chrome/common/extensions/manifest_tests/extension_manifest_test.cc b/chrome/common/extensions/manifest_tests/extension_manifest_test.cc
index caef6c3..d961977 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifest_test.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifest_test.cc
@@ -116,6 +116,30 @@ scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectSuccess(
return LoadAndExpectSuccess(Manifest(manifest_name), location, flags);
}
+scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning(
+ const Manifest& manifest,
+ const std::string& expected_warning,
+ Extension::Location location,
+ int flags) {
+ std::string error;
+ scoped_refptr<Extension> extension =
+ LoadExtension(manifest, &error, location, flags);
+ EXPECT_TRUE(extension) << manifest.name();
+ EXPECT_EQ("", error) << manifest.name();
+ EXPECT_EQ(1u, extension->install_warnings().size());
+ EXPECT_EQ(expected_warning, extension->install_warnings()[0]);
+ return extension;
+}
+
+scoped_refptr<Extension> ExtensionManifestTest::LoadAndExpectWarning(
+ char const* manifest_name,
+ const std::string& expected_warning,
+ Extension::Location location,
+ int flags) {
+ return LoadAndExpectWarning(
+ Manifest(manifest_name), expected_warning, location, flags);
+}
+
void ExtensionManifestTest::VerifyExpectedError(
Extension* extension,
const std::string& name,
@@ -149,7 +173,6 @@ void ExtensionManifestTest::LoadAndExpectError(
Manifest(manifest_name), expected_error, location, flags);
}
-
void ExtensionManifestTest::AddPattern(URLPatternSet* extent,
const std::string& pattern) {
int schemes = URLPattern::SCHEME_ALL;
@@ -201,6 +224,14 @@ void ExtensionManifestTest::RunTestcases(const Testcase* testcases,
testcases[i].flags_);
}
break;
+ case EXPECT_TYPE_WARNING:
+ for (size_t i = 0; i < num_testcases; ++i) {
+ LoadAndExpectWarning(testcases[i].manifest_filename_.c_str(),
+ testcases[i].expected_error_,
+ testcases[i].location_,
+ testcases[i].flags_);
+ }
+ break;
case EXPECT_TYPE_SUCCESS:
for (size_t i = 0; i < num_testcases; ++i) {
LoadAndExpectSuccess(testcases[i].manifest_filename_.c_str(),
diff --git a/chrome/common/extensions/manifest_tests/extension_manifest_test.h b/chrome/common/extensions/manifest_tests/extension_manifest_test.h
index b125dfa..4e8741c 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifest_test.h
+++ b/chrome/common/extensions/manifest_tests/extension_manifest_test.h
@@ -73,6 +73,20 @@ class ExtensionManifestTest : public testing::Test {
extensions::Extension::INTERNAL,
int flags = extensions::Extension::NO_FLAGS);
+ scoped_refptr<extensions::Extension> LoadAndExpectWarning(
+ const Manifest& manifest,
+ const std::string& expected_error,
+ extensions::Extension::Location location =
+ extensions::Extension::INTERNAL,
+ int flags = extensions::Extension::NO_FLAGS);
+
+ scoped_refptr<extensions::Extension> LoadAndExpectWarning(
+ char const* manifest_name,
+ const std::string& expected_error,
+ extensions::Extension::Location location =
+ extensions::Extension::INTERNAL,
+ int flags = extensions::Extension::NO_FLAGS);
+
void VerifyExpectedError(extensions::Extension* extension,
const std::string& name,
const std::string& error,
@@ -92,9 +106,13 @@ class ExtensionManifestTest : public testing::Test {
void AddPattern(URLPatternSet* extent, const std::string& pattern);
- // used to differentiate between calls to LoadAndExpectError and
- // LoadAndExpectSuccess via function RunTestcases
- enum EXPECT_TYPE { EXPECT_TYPE_ERROR, EXPECT_TYPE_SUCCESS };
+ // used to differentiate between calls to LoadAndExpectError,
+ // LoadAndExpectWarning and LoadAndExpectSuccess via function RunTestcases.
+ enum EXPECT_TYPE {
+ EXPECT_TYPE_ERROR,
+ EXPECT_TYPE_WARNING,
+ EXPECT_TYPE_SUCCESS
+ };
struct Testcase {
std::string manifest_filename_;
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
index 7bd211d..83bbbc9 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
@@ -68,11 +68,9 @@ TEST_F(ExtensionManifestTest, BackgroundPage) {
manifest->SetInteger(keys::kManifestVersion, 2);
Feature* feature = SimpleFeatureProvider::GetManifestFeatures()->
GetFeature("background_page");
- extension = LoadAndExpectSuccess(Manifest(manifest.get(), ""));
- ASSERT_TRUE(extension);
- ASSERT_EQ(1u, extension->install_warnings().size());
- EXPECT_EQ(feature->GetErrorMessage(Feature::INVALID_MAX_MANIFEST_VERSION),
- extension->install_warnings()[0]);
+ LoadAndExpectWarning(
+ Manifest(manifest.get(), ""),
+ feature->GetErrorMessage(Feature::INVALID_MAX_MANIFEST_VERSION));
}
TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) {
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
index ab7a852..2805077 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
@@ -24,20 +24,35 @@ TEST_F(ExtensionManifestTest, PlatformApps) {
LoadAndExpectSuccess("init_valid_platform_app.json");
EXPECT_TRUE(extension->is_storage_isolated());
- extension = LoadAndExpectSuccess("init_invalid_platform_app_1.json");
- ASSERT_TRUE(extension);
- ASSERT_EQ(1u, extension->install_warnings().size());
- EXPECT_EQ("'app.launch' is not allowed for specified package type "
- "(theme, app, etc.).",
- extension->install_warnings()[0]);
-
- LoadAndExpectError(
- "init_invalid_platform_app_2.json",
- extension_manifest_errors::kBackgroundRequiredForPlatformApps);
-
- LoadAndExpectError(
- "init_invalid_platform_app_3.json",
- extension_manifest_errors::kPlatformAppNeedsManifestVersion2);
+ LoadAndExpectWarning(
+ "init_invalid_platform_app_1.json",
+ "'app.launch' is not allowed for specified package type "
+ "(theme, app, etc.).");
+
+ Testcase error_testcases[] = {
+ Testcase("init_invalid_platform_app_2.json",
+ errors::kBackgroundRequiredForPlatformApps),
+ Testcase("init_invalid_platform_app_3.json",
+ errors::kPlatformAppNeedsManifestVersion2),
+ };
+ RunTestcases(error_testcases, arraysize(error_testcases), EXPECT_TYPE_ERROR);
+
+ Testcase warning_testcases[] = {
+ Testcase(
+ "init_invalid_platform_app_1.json",
+ "'app.launch' is not allowed for specified package type "
+ "(theme, app, etc.)."),
+ Testcase(
+ "init_invalid_platform_app_4.json",
+ "'background' is not allowed for specified package type "
+ "(theme, app, etc.)."),
+ Testcase(
+ "init_invalid_platform_app_5.json",
+ "'background' is not allowed for specified package type "
+ "(theme, app, etc.).")
+ };
+ RunTestcases(
+ warning_testcases, arraysize(warning_testcases), EXPECT_TYPE_WARNING);
}
TEST_F(ExtensionManifestTest, CertainApisRequirePlatformApps) {
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc
index e020bf0..ad2ab7f 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc
@@ -25,13 +25,7 @@ TEST_F(ExtensionManifestTest, StorageAPIManifestVersionAvailability) {
// Extension with no manifest version cannot use storage API.
{
Manifest manifest(&base_manifest, "test");
- scoped_refptr<extensions::Extension> extension =
- LoadAndExpectSuccess(manifest);
- if (extension.get()) {
- std::vector<std::string> warnings;
- warnings.push_back(kManifestVersionError);
- EXPECT_EQ(warnings, extension->install_warnings());
- }
+ LoadAndExpectWarning(manifest, kManifestVersionError);
}
// Extension with manifest version 1 cannot use storage API.
@@ -41,13 +35,7 @@ TEST_F(ExtensionManifestTest, StorageAPIManifestVersionAvailability) {
manifest_with_version.MergeDictionary(&base_manifest);
Manifest manifest(&manifest_with_version, "test");
- scoped_refptr<extensions::Extension> extension =
- LoadAndExpectSuccess(manifest);
- if (extension.get()) {
- std::vector<std::string> warnings;
- warnings.push_back(kManifestVersionError);
- EXPECT_EQ(warnings, extension->install_warnings());
- }
+ LoadAndExpectWarning(manifest, kManifestVersionError);
}
// Extension with manifest version 2 *can* use storage API.
@@ -59,9 +47,6 @@ TEST_F(ExtensionManifestTest, StorageAPIManifestVersionAvailability) {
Manifest manifest(&manifest_with_version, "test");
scoped_refptr<extensions::Extension> extension =
LoadAndExpectSuccess(manifest);
- if (extension.get()) {
- std::vector<std::string> empty;
- EXPECT_EQ(empty, extension->install_warnings());
- }
+ EXPECT_TRUE(extension->install_warnings().empty());
}
}
diff --git a/chrome/common/extensions/manifest_unittest.cc b/chrome/common/extensions/manifest_unittest.cc
index a674b4e..48f079f 100644
--- a/chrome/common/extensions/manifest_unittest.cc
+++ b/chrome/common/extensions/manifest_unittest.cc
@@ -134,24 +134,18 @@ TEST_F(ManifestTest, ExtensionTypes) {
MutateManifest(
&manifest, keys::kTheme, NULL);
- // Platform app.
- MutateManifest(
- &manifest, keys::kPlatformApp, new DictionaryValue());
- AssertType(manifest.get(), Extension::TYPE_EXTENSION); // must be boolean
- MutateManifest(
- &manifest, keys::kPlatformApp, Value::CreateBooleanValue(false));
- AssertType(manifest.get(), Extension::TYPE_EXTENSION); // must be true
- MutateManifest(
- &manifest, keys::kPlatformApp, Value::CreateBooleanValue(true));
- AssertType(manifest.get(), Extension::TYPE_PLATFORM_APP);
- MutateManifest(
- &manifest, keys::kPlatformApp, NULL);
-
// Packaged app.
MutateManifest(
&manifest, keys::kApp, new DictionaryValue());
AssertType(manifest.get(), Extension::TYPE_PACKAGED_APP);
+ // Platform app.
+ MutateManifest(
+ &manifest, keys::kPlatformAppBackground, new DictionaryValue());
+ AssertType(manifest.get(), Extension::TYPE_PLATFORM_APP);
+ MutateManifest(
+ &manifest, keys::kPlatformAppBackground, NULL);
+
// Hosted app.
MutateManifest(
&manifest, keys::kWebURLs, new ListValue());
@@ -188,12 +182,12 @@ TEST_F(ManifestTest, RestrictedKeys) {
EXPECT_TRUE(manifest->Get(keys::kPageAction, &output));
MutateManifest(
- &manifest, keys::kPlatformApp, Value::CreateBooleanValue(true));
+ &manifest, keys::kPlatformAppBackground, new DictionaryValue());
AssertType(manifest.get(), Extension::TYPE_PLATFORM_APP);
EXPECT_FALSE(manifest->HasKey(keys::kPageAction));
EXPECT_FALSE(manifest->Get(keys::kPageAction, &output));
MutateManifest(
- &manifest, keys::kPlatformApp, NULL);
+ &manifest, keys::kPlatformAppBackground, NULL);
// "commands" is restricted to manifest_version >= 2.
MutateManifest(
diff --git a/chrome/test/data/extensions/allow_silent_upgrade/scopes1_new.json b/chrome/test/data/extensions/allow_silent_upgrade/scopes1_new.json
index 0f124b4..4185c2c 100644
--- a/chrome/test/data/extensions/allow_silent_upgrade/scopes1_new.json
+++ b/chrome/test/data/extensions/allow_silent_upgrade/scopes1_new.json
@@ -6,6 +6,7 @@
"client_id": "my-client-id",
"scopes": ["scope1", "scope2"]
},
- "platform_app": true,
- "background": {"scripts": ["background.js"]}
+ "app": {
+ "background": {"scripts": ["background.js"]}
+ }
}
diff --git a/chrome/test/data/extensions/allow_silent_upgrade/scopes1_old.json b/chrome/test/data/extensions/allow_silent_upgrade/scopes1_old.json
index 66873e4..2eae03c 100644
--- a/chrome/test/data/extensions/allow_silent_upgrade/scopes1_old.json
+++ b/chrome/test/data/extensions/allow_silent_upgrade/scopes1_old.json
@@ -6,6 +6,7 @@
"client_id": "my-client-id",
"scopes": ["scope1"]
},
- "platform_app": true,
- "background": {"scripts": ["background.js"]}
+ "app": {
+ "background": {"scripts": ["background.js"]}
+ }
}
diff --git a/chrome/test/data/extensions/allow_silent_upgrade/scopes2_new.json b/chrome/test/data/extensions/allow_silent_upgrade/scopes2_new.json
index 95b8ab8..a635e12 100644
--- a/chrome/test/data/extensions/allow_silent_upgrade/scopes2_new.json
+++ b/chrome/test/data/extensions/allow_silent_upgrade/scopes2_new.json
@@ -6,6 +6,7 @@
"client_id": "my-client-id",
"scopes": ["scope1"]
},
- "platform_app": true,
- "background": {"scripts": ["background.js"]}
+ "app": {
+ "background": {"scripts": ["background.js"]}
+ }
}
diff --git a/chrome/test/data/extensions/allow_silent_upgrade/scopes2_old.json b/chrome/test/data/extensions/allow_silent_upgrade/scopes2_old.json
index 09e3158..0156557 100644
--- a/chrome/test/data/extensions/allow_silent_upgrade/scopes2_old.json
+++ b/chrome/test/data/extensions/allow_silent_upgrade/scopes2_old.json
@@ -6,6 +6,7 @@
"client_id": "my-client-id",
"scopes": ["scope1", "scope2"]
},
- "platform_app": true,
- "background": {"scripts": ["background.js"]}
+ "app": {
+ "background": {"scripts": ["background.js"]}
+ }
}
diff --git a/chrome/test/data/extensions/allow_silent_upgrade/scopes3_new.json b/chrome/test/data/extensions/allow_silent_upgrade/scopes3_new.json
index 95b8ab8..a635e12 100644
--- a/chrome/test/data/extensions/allow_silent_upgrade/scopes3_new.json
+++ b/chrome/test/data/extensions/allow_silent_upgrade/scopes3_new.json
@@ -6,6 +6,7 @@
"client_id": "my-client-id",
"scopes": ["scope1"]
},
- "platform_app": true,
- "background": {"scripts": ["background.js"]}
+ "app": {
+ "background": {"scripts": ["background.js"]}
+ }
}
diff --git a/chrome/test/data/extensions/allow_silent_upgrade/scopes3_old.json b/chrome/test/data/extensions/allow_silent_upgrade/scopes3_old.json
index 1bc2313..3730cf4 100644
--- a/chrome/test/data/extensions/allow_silent_upgrade/scopes3_old.json
+++ b/chrome/test/data/extensions/allow_silent_upgrade/scopes3_old.json
@@ -2,6 +2,7 @@
"name": "allow silent update",
"version": "1.0",
"manifest_version": 2,
- "platform_app": true,
- "background": {"scripts": ["background.js"]}
+ "app": {
+ "background": {"scripts": ["background.js"]}
+ }
}
diff --git a/chrome/test/data/extensions/api_test/dns/api/manifest.json b/chrome/test/data/extensions/api_test/dns/api/manifest.json
index a9eec3e..789980b 100644
--- a/chrome/test/data/extensions/api_test/dns/api/manifest.json
+++ b/chrome/test/data/extensions/api_test/dns/api/manifest.json
@@ -3,9 +3,10 @@
"version": "0.1",
"manifest_version": 2,
"description": "end-to-end browser test for chrome.experimental.dns API",
- "platform_app": true,
- "background": {
- "scripts": ["background.js"]
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
},
"permissions": [
"experimental",
diff --git a/chrome/test/data/extensions/api_test/identity/manifest.json b/chrome/test/data/extensions/api_test/identity/manifest.json
index ef6eaac..7e852b3 100644
--- a/chrome/test/data/extensions/api_test/identity/manifest.json
+++ b/chrome/test/data/extensions/api_test/identity/manifest.json
@@ -2,9 +2,10 @@
"name": "identity api test",
"manifest_version": 2,
"version": "1",
- "platform_app": true,
"permissions": ["experimental"],
- "background": {"scripts": ["test.js"]},
+ "app": {
+ "background": {"scripts": ["test.js"]}
+ },
"oauth2": {
"client_id": "dummy_client_id",
"scopes": [ "http://dummy/scope" ]
diff --git a/chrome/test/data/extensions/api_test/serial/api/manifest.json b/chrome/test/data/extensions/api_test/serial/api/manifest.json
index cddb1fb..c8d1aa4 100644
--- a/chrome/test/data/extensions/api_test/serial/api/manifest.json
+++ b/chrome/test/data/extensions/api_test/serial/api/manifest.json
@@ -3,9 +3,10 @@
"version": "0.1",
"manifest_version": 2,
"description": "end-to-end browser test for chrome.experimental.serial API",
- "platform_app": true,
- "background": {
- "scripts": ["background.js"]
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
},
"permissions": [
"experimental",
diff --git a/chrome/test/data/extensions/api_test/socket/api/manifest.json b/chrome/test/data/extensions/api_test/socket/api/manifest.json
index 0c045f9..4ca5cac 100644
--- a/chrome/test/data/extensions/api_test/socket/api/manifest.json
+++ b/chrome/test/data/extensions/api_test/socket/api/manifest.json
@@ -3,9 +3,10 @@
"version": "0.1",
"manifest_version": 2,
"description": "end-to-end browser test for chrome.experimental.socket API",
- "platform_app": true,
- "background": {
- "scripts": ["background.js"]
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
},
"permissions": [
"experimental",
diff --git a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_1.json b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_1.json
index 186e223..db7fdf5 100644
--- a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_1.json
+++ b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_1.json
@@ -1,12 +1,11 @@
{
"name": "Platform Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- "scripts": ["background.js"]
- },
"app": {
+ "background": {
+ "scripts": ["background.js"]
+ },
"launch": {
// Launch section is not allowed for platform apps.
}
diff --git a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_2.json b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_2.json
index 5d5da90..5462bb3 100644
--- a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_2.json
+++ b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_2.json
@@ -1,9 +1,10 @@
{
"name": "Platform Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- // Platform apps must have a background page or scripts
+ "app": {
+ "background": {
+ // Platform apps must have a background page or scripts
+ }
}
}
diff --git a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_3.json b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_3.json
index d878dd88..14bd869 100644
--- a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_3.json
+++ b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_3.json
@@ -1,9 +1,10 @@
{
"name": "Platform Test",
- "platform_app": true,
"version": "1",
- "background": {
- "scripts": ["background.js"]
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
}
// "manifest_version": 2 is required
}
diff --git a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_4.json b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_4.json
new file mode 100644
index 0000000..34ffe6f
--- /dev/null
+++ b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_4.json
@@ -0,0 +1,14 @@
+{
+ "name": "Platform Test",
+ "version": "1",
+ "manifest_version": 2,
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
+ },
+ // "background.scripts" outside of "app"
+ "background": {
+ "scripts": ["background.js"]
+ }
+}
diff --git a/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_5.json b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_5.json
new file mode 100644
index 0000000..9f9f84f
--- /dev/null
+++ b/chrome/test/data/extensions/manifest_tests/init_invalid_platform_app_5.json
@@ -0,0 +1,14 @@
+{
+ "name": "Platform Test",
+ "version": "1",
+ "manifest_version": 2,
+ "app": {
+ "background": {
+ "page": "background.html"
+ }
+ },
+ // "background.page" outside of "app"
+ "background": {
+ "page": "background.html"
+ }
+}
diff --git a/chrome/test/data/extensions/manifest_tests/init_valid_platform_app.json b/chrome/test/data/extensions/manifest_tests/init_valid_platform_app.json
index a05b5d3..03ed62f 100644
--- a/chrome/test/data/extensions/manifest_tests/init_valid_platform_app.json
+++ b/chrome/test/data/extensions/manifest_tests/init_valid_platform_app.json
@@ -1,9 +1,10 @@
{
"name": "Platform Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- "scripts": ["background.js"]
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/manifest_tests/sandboxed_pages_invalid_5.json b/chrome/test/data/extensions/manifest_tests/sandboxed_pages_invalid_5.json
index 5888cde..26b9596 100644
--- a/chrome/test/data/extensions/manifest_tests/sandboxed_pages_invalid_5.json
+++ b/chrome/test/data/extensions/manifest_tests/sandboxed_pages_invalid_5.json
@@ -2,9 +2,10 @@
"name": "test",
"version": "0.1",
"manifest_version": 2,
- "platform_app": true,
- "background": {
- "scripts": ["background.js"]
+ "app": {
+ "background": {
+ "scripts": ["background.js"]
+ }
},
"sandbox": {
"pages": ["test"],
diff --git a/chrome/test/data/extensions/platform_apps/context_menu/manifest.json b/chrome/test/data/extensions/platform_apps/context_menu/manifest.json
index 4bd3363..50068e4 100644
--- a/chrome/test/data/extensions/platform_apps/context_menu/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/context_menu/manifest.json
@@ -1,6 +1,5 @@
{
"name" : "Platform App Context Menus Test Extension",
- "platform_app": true,
"version" : "0.1",
"manifest_version": 2,
"permissions": [
@@ -8,7 +7,9 @@
"appWindow",
"contextMenus"
],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/get_display_path/manifest.json b/chrome/test/data/extensions/platform_apps/get_display_path/manifest.json
index 526abff..c450be1 100644
--- a/chrome/test/data/extensions/platform_apps/get_display_path/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/get_display_path/manifest.json
@@ -1,6 +1,5 @@
{
"name": "Platform App fileSystem.getDisplayPath test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"intents": {
@@ -12,7 +11,9 @@
}
},
"permissions": ["experimental", "fileSystem"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/iframes/manifest.json b/chrome/test/data/extensions/platform_apps/iframes/manifest.json
index 32b4de32..31d5cb5 100644
--- a/chrome/test/data/extensions/platform_apps/iframes/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/iframes/manifest.json
@@ -1,14 +1,15 @@
{
"name": "Platform App Test: local iframes are allowed",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"permissions": [
"experimental",
"appWindow"
],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
},
// Attempt to specify a Content Security Policy that is more relaxed than the
// default (would allow remote iframes). It should be ignored.
diff --git a/chrome/test/data/extensions/platform_apps/isolation/manifest.json b/chrome/test/data/extensions/platform_apps/isolation/manifest.json
index de41c883c..f8f3fd7 100644
--- a/chrome/test/data/extensions/platform_apps/isolation/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/isolation/manifest.json
@@ -1,10 +1,11 @@
{
"name": "Platform App Test: isolated storage",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
},
"permissions": [
"http://localhost/"
diff --git a/chrome/test/data/extensions/platform_apps/launch/manifest.json b/chrome/test/data/extensions/platform_apps/launch/manifest.json
index 33c8115..6b1678b 100644
--- a/chrome/test/data/extensions/platform_apps/launch/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch/manifest.json
@@ -1,10 +1,11 @@
{
"name": "Platform App Test: onLaunched event test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
},
"permissions": [
"experimental"
diff --git a/chrome/test/data/extensions/platform_apps/launch_file/manifest.json b/chrome/test/data/extensions/platform_apps/launch_file/manifest.json
index 2f31fff..c60ea5e 100644
--- a/chrome/test/data/extensions/platform_apps/launch_file/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch_file/manifest.json
@@ -1,6 +1,5 @@
{
"name": "Platform App Launch Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"intents": {
@@ -12,7 +11,9 @@
}
},
"permissions": ["experimental"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/launch_invalid/manifest.json b/chrome/test/data/extensions/platform_apps/launch_invalid/manifest.json
index 2f31fff..c60ea5e 100644
--- a/chrome/test/data/extensions/platform_apps/launch_invalid/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch_invalid/manifest.json
@@ -1,6 +1,5 @@
{
"name": "Platform App Launch Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"intents": {
@@ -12,7 +11,9 @@
}
},
"permissions": ["experimental"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/launch_no_intent/manifest.json b/chrome/test/data/extensions/platform_apps/launch_no_intent/manifest.json
index 084addf..fb3fbe8 100644
--- a/chrome/test/data/extensions/platform_apps/launch_no_intent/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch_no_intent/manifest.json
@@ -1,10 +1,11 @@
{
"name": "Platform App Launch Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"permissions": ["experimental"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/launch_nothing/manifest.json b/chrome/test/data/extensions/platform_apps/launch_nothing/manifest.json
index 2f31fff..c60ea5e 100644
--- a/chrome/test/data/extensions/platform_apps/launch_nothing/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch_nothing/manifest.json
@@ -1,6 +1,5 @@
{
"name": "Platform App Launch Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"intents": {
@@ -12,7 +11,9 @@
}
},
"permissions": ["experimental"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/launch_wrong_intent/manifest.json b/chrome/test/data/extensions/platform_apps/launch_wrong_intent/manifest.json
index 91e2ea7..da45c13 100644
--- a/chrome/test/data/extensions/platform_apps/launch_wrong_intent/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch_wrong_intent/manifest.json
@@ -1,6 +1,5 @@
{
"name": "Platform App Launch Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"intents": {
@@ -12,7 +11,9 @@
}
},
"permissions": ["experimental"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/launch_wrong_type/manifest.json b/chrome/test/data/extensions/platform_apps/launch_wrong_type/manifest.json
index d29492a..cecf25b 100644
--- a/chrome/test/data/extensions/platform_apps/launch_wrong_type/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/launch_wrong_type/manifest.json
@@ -1,6 +1,5 @@
{
"name": "Platform App Launch Test",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"intents": {
@@ -12,7 +11,9 @@
}
},
"permissions": ["experimental"],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/minimal/manifest.json b/chrome/test/data/extensions/platform_apps/minimal/manifest.json
index 0f3b6f2..fc44eb4 100644
--- a/chrome/test/data/extensions/platform_apps/minimal/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/minimal/manifest.json
@@ -1,13 +1,14 @@
{
"name": "Platform App Test: minimal platform app",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"permissions": [
"experimental",
"appWindow"
],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/navigation/manifest.json b/chrome/test/data/extensions/platform_apps/navigation/manifest.json
index ec6b8f3..1e81ca1 100644
--- a/chrome/test/data/extensions/platform_apps/navigation/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/navigation/manifest.json
@@ -1,13 +1,14 @@
{
"name": "Platform App Test: navigation is disallowed",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"permissions": [
"experimental",
"appWindow"
],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/restrictions/manifest.json b/chrome/test/data/extensions/platform_apps/restrictions/manifest.json
index a031899..48d6761 100644
--- a/chrome/test/data/extensions/platform_apps/restrictions/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/restrictions/manifest.json
@@ -1,9 +1,10 @@
{
"name": "Platform App Test: various document and window restrictions",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/storage/manifest.json b/chrome/test/data/extensions/platform_apps/storage/manifest.json
index e71b073..b26ed69 100644
--- a/chrome/test/data/extensions/platform_apps/storage/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/storage/manifest.json
@@ -1,9 +1,10 @@
{
"name": "Platform App Test: localStorage/WebSQL are disallowed",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}
diff --git a/chrome/test/data/extensions/platform_apps/windows_api/manifest.json b/chrome/test/data/extensions/platform_apps/windows_api/manifest.json
index d068188..f76405d 100644
--- a/chrome/test/data/extensions/platform_apps/windows_api/manifest.json
+++ b/chrome/test/data/extensions/platform_apps/windows_api/manifest.json
@@ -1,13 +1,14 @@
{
"name": "Platform App Test: Windows API",
- "platform_app": true,
"version": "1",
"manifest_version": 2,
"permissions": [
"experimental",
"appWindow"
],
- "background": {
- "scripts": ["test.js"]
+ "app": {
+ "background": {
+ "scripts": ["test.js"]
+ }
}
}