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

Unified Diff: chrome/browser/extensions/extension_content_settings_apitest.cc

Issue 7041005: Content settings extension API: Implement ContentSetting.getResourceIdentifiers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_content_settings_apitest.cc
diff --git a/chrome/browser/extensions/extension_content_settings_apitest.cc b/chrome/browser/extensions/extension_content_settings_apitest.cc
index 0d8a704ebb01443b66954c2f96b078aa8a259504..078c009ccaf83dc42d1b5c098eeccf1956d7dd9e 100644
--- a/chrome/browser/extensions/extension_content_settings_apitest.cc
+++ b/chrome/browser/extensions/extension_content_settings_apitest.cc
@@ -2,13 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/utf_string_conversions.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/extensions/extension_content_settings_api.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
+#include "webkit/plugins/npapi/mock_plugin_list.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) {
CommandLine::ForCurrentProcess()->AppendSwitch(
@@ -169,3 +172,39 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettingsOnChange) {
EXPECT_TRUE(RunExtensionTestIncognito("content_settings/onchange")) <<
message_;
}
+
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
+ ContentSettingsGetResourceIdentifiers) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableExperimentalExtensionApis);
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableResourceContentSettings);
+
+ FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin");
+ FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin");
+ const char* kFooName = "Foo Plugin";
+ const char* kBarName = "Bar Plugin";
+ const webkit::npapi::PluginGroupDefinition kPluginDefinitions[] = {
+ { "foo", "Foo", kFooName, NULL, 0,
+ "http://example.com/foo" },
battre 2011/06/15 12:53:39 nit: single line?
+ };
+
+ webkit::npapi::MockPluginList plugin_list(kPluginDefinitions,
+ arraysize(kPluginDefinitions));
+ plugin_list.AddPluginToLoad(
+ webkit::npapi::WebPluginInfo(ASCIIToUTF16(kFooName),
+ FilePath(kFooPath),
+ ASCIIToUTF16("1.2.3"),
+ ASCIIToUTF16("foo")));
+ plugin_list.AddPluginToLoad(
+ webkit::npapi::WebPluginInfo(ASCIIToUTF16(kBarName),
+ FilePath(kBarPath),
+ ASCIIToUTF16("2.3.4"),
+ ASCIIToUTF16("bar")));
+ GetResourceIdentifiersFunction::SetPluginListForTesting(&plugin_list);
+
+ EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers"))
+ << message_;
+
+ GetResourceIdentifiersFunction::SetPluginListForTesting(NULL);
+}

Powered by Google App Engine
This is Rietveld 408576698