summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_manifests_unittest.cc
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-16 21:11:55 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-16 21:11:55 +0000
commit1abdf4f00771d35feddd9f204b6ea46470f31f21 (patch)
tree0143e940a4148912045de61785bf4b30491b40fc /chrome/common/extensions/extension_manifests_unittest.cc
parent2e5b90c3b35ef01872bb68aae1f8928602159fff (diff)
downloadchromium_src-1abdf4f00771d35feddd9f204b6ea46470f31f21.zip
chromium_src-1abdf4f00771d35feddd9f204b6ea46470f31f21.tar.gz
chromium_src-1abdf4f00771d35feddd9f204b6ea46470f31f21.tar.bz2
Add offline_enabled field in manifest.
Packaged apps (and extensions) can declare themselves to be offline-enabled. BUG=89655 TEST=added ExtensionManifestTest.OfflineEnabled Review URL: http://codereview.chromium.org/7645033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_manifests_unittest.cc')
-rw-r--r--chrome/common/extensions/extension_manifests_unittest.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc
index 2fd647c..3d7ed44 100644
--- a/chrome/common/extensions/extension_manifests_unittest.cc
+++ b/chrome/common/extensions/extension_manifests_unittest.cc
@@ -600,7 +600,7 @@ TEST_F(ExtensionManifestTest, DisallowHybridApps) {
TEST_F(ExtensionManifestTest, OptionsPageInApps) {
scoped_refptr<Extension> extension;
- // Allow options page with absolute URL in hosed apps.
+ // Allow options page with absolute URL in hosted apps.
extension = LoadAndExpectSuccess("hosted_app_absolute_options.json");
EXPECT_STREQ("http",
extension->options_url().scheme().c_str());
@@ -826,3 +826,23 @@ TEST_F(ExtensionManifestTest, FileManagerURLOverride) {
LoadAndExpectError("filebrowser_url_override.json",
errors::kInvalidChromeURLOverrides);
}
+
+TEST_F(ExtensionManifestTest, OfflineEnabled) {
+ LoadAndExpectError("offline_enabled_invalid.json",
+ errors::kInvalidOfflineEnabled);
+ scoped_refptr<Extension> extension_0(
+ LoadAndExpectSuccess("offline_enabled_extension.json"));
+ EXPECT_TRUE(extension_0->offline_enabled());
+ scoped_refptr<Extension> extension_1(
+ LoadAndExpectSuccess("offline_enabled_packaged_app.json"));
+ EXPECT_TRUE(extension_1->offline_enabled());
+ scoped_refptr<Extension> extension_2(
+ LoadAndExpectSuccess("offline_disabled_packaged_app.json"));
+ EXPECT_FALSE(extension_2->offline_enabled());
+ scoped_refptr<Extension> extension_3(
+ LoadAndExpectSuccess("offline_default_packaged_app.json"));
+ EXPECT_FALSE(extension_3->offline_enabled());
+ scoped_refptr<Extension> extension_4(
+ LoadAndExpectSuccess("offline_enabled_hosted_app.json"));
+ EXPECT_TRUE(extension_4->offline_enabled());
+}