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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/content_settings/cookie_settings.h" | 6 #include "chrome/browser/content_settings/cookie_settings.h" |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_content_settings_api.h" | 9 #include "chrome/browser/extensions/extension_content_settings_api.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, | 96 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
97 DISABLED_ContentSettingsGetResourceIdentifiers) { | 97 DISABLED_ContentSettingsGetResourceIdentifiers) { |
98 CommandLine::ForCurrentProcess()->AppendSwitch( | 98 CommandLine::ForCurrentProcess()->AppendSwitch( |
99 switches::kEnableExperimentalExtensionApis); | 99 switches::kEnableExperimentalExtensionApis); |
100 | 100 |
101 FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin"); | 101 FilePath::CharType kFooPath[] = FILE_PATH_LITERAL("/plugins/foo.plugin"); |
102 FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin"); | 102 FilePath::CharType kBarPath[] = FILE_PATH_LITERAL("/plugins/bar.plugin"); |
103 const char* kFooName = "Foo Plugin"; | 103 const char* kFooName = "Foo Plugin"; |
104 const char* kBarName = "Bar Plugin"; | 104 const char* kBarName = "Bar Plugin"; |
105 const webkit::npapi::PluginGroupDefinition kPluginDefinitions[] = { | 105 const webkit::npapi::PluginGroupDefinition kPluginDefinitions[] = { |
106 { "foo", "Foo", kFooName, NULL, 0 }, | 106 { "foo", "Foo", kFooName, NULL, 0, |
| 107 "http://example.com/foo" }, |
107 }; | 108 }; |
108 | 109 |
109 webkit::npapi::MockPluginList plugin_list(kPluginDefinitions, | 110 webkit::npapi::MockPluginList plugin_list(kPluginDefinitions, |
110 arraysize(kPluginDefinitions)); | 111 arraysize(kPluginDefinitions)); |
111 plugin_list.AddPluginToLoad( | 112 plugin_list.AddPluginToLoad( |
112 webkit::WebPluginInfo(ASCIIToUTF16(kFooName), | 113 webkit::WebPluginInfo(ASCIIToUTF16(kFooName), |
113 FilePath(kFooPath), | 114 FilePath(kFooPath), |
114 ASCIIToUTF16("1.2.3"), | 115 ASCIIToUTF16("1.2.3"), |
115 ASCIIToUTF16("foo"))); | 116 ASCIIToUTF16("foo"))); |
116 plugin_list.AddPluginToLoad( | 117 plugin_list.AddPluginToLoad( |
117 webkit::WebPluginInfo(ASCIIToUTF16(kBarName), | 118 webkit::WebPluginInfo(ASCIIToUTF16(kBarName), |
118 FilePath(kBarPath), | 119 FilePath(kBarPath), |
119 ASCIIToUTF16("2.3.4"), | 120 ASCIIToUTF16("2.3.4"), |
120 ASCIIToUTF16("bar"))); | 121 ASCIIToUTF16("bar"))); |
121 | 122 |
122 std::vector<webkit::npapi::PluginGroup> groups; | 123 std::vector<webkit::npapi::PluginGroup> groups; |
123 plugin_list.GetPluginGroups(true, &groups); | 124 plugin_list.GetPluginGroups(true, &groups); |
124 | 125 |
125 GetResourceIdentifiersFunction::SetPluginGroupsForTesting(&groups); | 126 GetResourceIdentifiersFunction::SetPluginGroupsForTesting(&groups); |
126 | 127 |
127 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) | 128 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) |
128 << message_; | 129 << message_; |
129 | 130 |
130 GetResourceIdentifiersFunction::SetPluginGroupsForTesting(NULL); | 131 GetResourceIdentifiersFunction::SetPluginGroupsForTesting(NULL); |
131 } | 132 } |
OLD | NEW |