Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: chrome/common/extensions/extension_manifests_unittest.cc

Issue 9837074: Make it so that allow_js_access: false can be used with background pages created by window.open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revised approach based on http://crrev.com/125180. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 manifest->SetString("background_page", "monkey.html"); 1100 manifest->SetString("background_page", "monkey.html");
1101 LoadAndExpectError(Manifest(manifest.get(), ""), 1101 LoadAndExpectError(Manifest(manifest.get(), ""),
1102 errors::kInvalidBackgroundCombination); 1102 errors::kInvalidBackgroundCombination);
1103 } 1103 }
1104 1104
1105 TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) { 1105 TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) {
1106 scoped_refptr<Extension> extension; 1106 scoped_refptr<Extension> extension;
1107 extension = LoadAndExpectSuccess("background_allow_no_js_access.json"); 1107 extension = LoadAndExpectSuccess("background_allow_no_js_access.json");
1108 ASSERT_TRUE(extension); 1108 ASSERT_TRUE(extension);
1109 EXPECT_FALSE(extension->allow_background_js_access()); 1109 EXPECT_FALSE(extension->allow_background_js_access());
1110
1111 extension = LoadAndExpectSuccess("background_allow_no_js_access2.json");
1112 ASSERT_TRUE(extension);
1113 EXPECT_FALSE(extension->allow_background_js_access());
1110 } 1114 }
1111 1115
1112 TEST_F(ExtensionManifestTest, PageActionManifestVersion2) { 1116 TEST_F(ExtensionManifestTest, PageActionManifestVersion2) {
1113 scoped_refptr<Extension> extension( 1117 scoped_refptr<Extension> extension(
1114 LoadAndExpectSuccess("page_action_manifest_version_2.json")); 1118 LoadAndExpectSuccess("page_action_manifest_version_2.json"));
1115 ASSERT_TRUE(extension.get()); 1119 ASSERT_TRUE(extension.get());
1116 ASSERT_TRUE(extension->page_action()); 1120 ASSERT_TRUE(extension->page_action());
1117 1121
1118 EXPECT_EQ("", extension->page_action()->id()); 1122 EXPECT_EQ("", extension->page_action()->id());
1119 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size()); 1123 EXPECT_EQ(0u, extension->page_action()->icon_paths()->size());
1120 EXPECT_EQ("", extension->page_action()->GetTitle( 1124 EXPECT_EQ("", extension->page_action()->GetTitle(
1121 ExtensionAction::kDefaultTabId)); 1125 ExtensionAction::kDefaultTabId));
1122 EXPECT_FALSE(extension->page_action()->HasPopup( 1126 EXPECT_FALSE(extension->page_action()->HasPopup(
1123 ExtensionAction::kDefaultTabId)); 1127 ExtensionAction::kDefaultTabId));
1124 1128
1125 LoadAndExpectError("page_action_manifest_version_2b.json", 1129 LoadAndExpectError("page_action_manifest_version_2b.json",
1126 errors::kInvalidPageActionPopup); 1130 errors::kInvalidPageActionPopup);
1127 } 1131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698