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 "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 manifest->SetString("background_page", "monkey.html"); | 1208 manifest->SetString("background_page", "monkey.html"); |
1209 LoadAndExpectError(Manifest(manifest.get(), ""), | 1209 LoadAndExpectError(Manifest(manifest.get(), ""), |
1210 errors::kInvalidBackgroundCombination); | 1210 errors::kInvalidBackgroundCombination); |
1211 } | 1211 } |
1212 | 1212 |
1213 TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) { | 1213 TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) { |
1214 scoped_refptr<Extension> extension; | 1214 scoped_refptr<Extension> extension; |
1215 extension = LoadAndExpectSuccess("background_allow_no_js_access.json"); | 1215 extension = LoadAndExpectSuccess("background_allow_no_js_access.json"); |
1216 ASSERT_TRUE(extension); | 1216 ASSERT_TRUE(extension); |
1217 EXPECT_FALSE(extension->allow_background_js_access()); | 1217 EXPECT_FALSE(extension->allow_background_js_access()); |
| 1218 |
| 1219 extension = LoadAndExpectSuccess("background_allow_no_js_access2.json"); |
| 1220 ASSERT_TRUE(extension); |
| 1221 EXPECT_FALSE(extension->allow_background_js_access()); |
1218 } | 1222 } |
1219 | 1223 |
1220 TEST_F(ExtensionManifestTest, PageActionManifestVersion2) { | 1224 TEST_F(ExtensionManifestTest, PageActionManifestVersion2) { |
1221 scoped_refptr<Extension> extension( | 1225 scoped_refptr<Extension> extension( |
1222 LoadAndExpectSuccess("page_action_manifest_version_2.json")); | 1226 LoadAndExpectSuccess("page_action_manifest_version_2.json")); |
1223 ASSERT_TRUE(extension.get()); | 1227 ASSERT_TRUE(extension.get()); |
1224 ASSERT_TRUE(extension->page_action()); | 1228 ASSERT_TRUE(extension->page_action()); |
1225 | 1229 |
1226 EXPECT_EQ("", extension->page_action()->id()); | 1230 EXPECT_EQ("", extension->page_action()->id()); |
1227 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size()); | 1231 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 // Extension with manifest version 2 *can* use storage API. | 1269 // Extension with manifest version 2 *can* use storage API. |
1266 { | 1270 { |
1267 DictionaryValue manifest_with_version; | 1271 DictionaryValue manifest_with_version; |
1268 manifest_with_version.SetInteger(keys::kManifestVersion, 2); | 1272 manifest_with_version.SetInteger(keys::kManifestVersion, 2); |
1269 manifest_with_version.MergeDictionary(&base_manifest); | 1273 manifest_with_version.MergeDictionary(&base_manifest); |
1270 | 1274 |
1271 Manifest manifest(&manifest_with_version, "test"); | 1275 Manifest manifest(&manifest_with_version, "test"); |
1272 LoadAndExpectSuccess(manifest); | 1276 LoadAndExpectSuccess(manifest); |
1273 } | 1277 } |
1274 } | 1278 } |
OLD | NEW |