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/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/content_settings/cookie_settings.h" | 7 #include "chrome/browser/content_settings/cookie_settings.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" | 9 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "content/public/browser/plugin_service.h" | 15 #include "content/public/browser/plugin_service.h" |
16 #include "webkit/plugins/webplugininfo.h" | 16 #include "content/public/common/webplugininfo.h" |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) { | 20 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) { |
21 CommandLine::ForCurrentProcess()->AppendSwitch( | 21 CommandLine::ForCurrentProcess()->AppendSwitch( |
22 switches::kEnableExperimentalExtensionApis); | 22 switches::kEnableExperimentalExtensionApis); |
23 | 23 |
24 EXPECT_TRUE(RunExtensionTest("content_settings/standard")) << message_; | 24 EXPECT_TRUE(RunExtensionTest("content_settings/standard")) << message_; |
25 | 25 |
26 HostContentSettingsMap* map = | 26 HostContentSettingsMap* map = |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 IN_PROC_BROWSER_TEST_F(ContentSettingsGetResourceIdentifiersTest, | 108 IN_PROC_BROWSER_TEST_F(ContentSettingsGetResourceIdentifiersTest, |
109 DISABLED_Test) { | 109 DISABLED_Test) { |
110 base::FilePath::CharType kFooPath[] = | 110 base::FilePath::CharType kFooPath[] = |
111 FILE_PATH_LITERAL("/plugins/foo.plugin"); | 111 FILE_PATH_LITERAL("/plugins/foo.plugin"); |
112 base::FilePath::CharType kBarPath[] = | 112 base::FilePath::CharType kBarPath[] = |
113 FILE_PATH_LITERAL("/plugins/bar.plugin"); | 113 FILE_PATH_LITERAL("/plugins/bar.plugin"); |
114 const char* kFooName = "Foo Plugin"; | 114 const char* kFooName = "Foo Plugin"; |
115 const char* kBarName = "Bar Plugin"; | 115 const char* kBarName = "Bar Plugin"; |
116 | 116 |
117 content::PluginService::GetInstance()->RegisterInternalPlugin( | 117 content::PluginService::GetInstance()->RegisterInternalPlugin( |
118 webkit::WebPluginInfo(ASCIIToUTF16(kFooName), | 118 content::WebPluginInfo(ASCIIToUTF16(kFooName), |
119 base::FilePath(kFooPath), | 119 base::FilePath(kFooPath), |
120 ASCIIToUTF16("1.2.3"), | 120 ASCIIToUTF16("1.2.3"), |
121 ASCIIToUTF16("foo")), | 121 ASCIIToUTF16("foo")), |
122 false); | 122 false); |
123 content::PluginService::GetInstance()->RegisterInternalPlugin( | 123 content::PluginService::GetInstance()->RegisterInternalPlugin( |
124 webkit::WebPluginInfo(ASCIIToUTF16(kBarName), | 124 content::WebPluginInfo(ASCIIToUTF16(kBarName), |
125 base::FilePath(kBarPath), | 125 base::FilePath(kBarPath), |
126 ASCIIToUTF16("2.3.4"), | 126 ASCIIToUTF16("2.3.4"), |
127 ASCIIToUTF16("bar")), | 127 ASCIIToUTF16("bar")), |
128 false); | 128 false); |
129 | 129 |
130 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) | 130 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) |
131 << message_; | 131 << message_; |
132 } | 132 } |
133 | 133 |
134 } // namespace extensions | 134 } // namespace extensions |
OLD | NEW |