| 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/utf_string_conversions.h" | 6 #include "base/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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 map->GetContentSetting(example_url, | 67 map->GetContentSetting(example_url, |
| 68 example_url, | 68 example_url, |
| 69 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 69 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| 70 std::string())); | 70 std::string())); |
| 71 | 71 |
| 72 // Check content settings for www.google.com | 72 // Check content settings for www.google.com |
| 73 GURL url("http://www.google.com"); | 73 GURL url("http://www.google.com"); |
| 74 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); | 74 EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); |
| 75 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 75 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 76 map->GetContentSetting( | 76 map->GetContentSetting( |
| 77 url, url, CONTENT_SETTINGS_TYPE_IMAGES, "")); | 77 url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); |
| 78 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 78 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 79 map->GetContentSetting( | 79 map->GetContentSetting( |
| 80 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); | 80 url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); |
| 81 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 81 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 82 map->GetContentSetting( | 82 map->GetContentSetting( |
| 83 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "")); | 83 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); |
| 84 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 84 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
| 85 map->GetContentSetting( | 85 map->GetContentSetting( |
| 86 url, url, CONTENT_SETTINGS_TYPE_POPUPS, "")); | 86 url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); |
| 87 #if 0 | 87 #if 0 |
| 88 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 88 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 89 map->GetContentSetting( | 89 map->GetContentSetting( |
| 90 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, "")); | 90 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, "")); |
| 91 #endif | 91 #endif |
| 92 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 92 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
| 93 map->GetContentSetting( | 93 map->GetContentSetting( |
| 94 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "")); | 94 url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); |
| 95 } | 95 } |
| 96 | 96 |
| 97 // Flaky on the trybots. See http://crbug.com/96725. | 97 // Flaky on the trybots. See http://crbug.com/96725. |
| 98 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, | 98 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, |
| 99 DISABLED_ContentSettingsGetResourceIdentifiers) { | 99 DISABLED_ContentSettingsGetResourceIdentifiers) { |
| 100 CommandLine::ForCurrentProcess()->AppendSwitch( | 100 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 101 switches::kEnableExperimentalExtensionApis); | 101 switches::kEnableExperimentalExtensionApis); |
| 102 | 102 |
| 103 base::FilePath::CharType kFooPath[] = | 103 base::FilePath::CharType kFooPath[] = |
| 104 FILE_PATH_LITERAL("/plugins/foo.plugin"); | 104 FILE_PATH_LITERAL("/plugins/foo.plugin"); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 126 SetPluginsForTesting(&plugins); | 126 SetPluginsForTesting(&plugins); |
| 127 | 127 |
| 128 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) | 128 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) |
| 129 << message_; | 129 << message_; |
| 130 | 130 |
| 131 ContentSettingsContentSettingGetResourceIdentifiersFunction:: | 131 ContentSettingsContentSettingGetResourceIdentifiersFunction:: |
| 132 SetPluginsForTesting(NULL); | 132 SetPluginsForTesting(NULL); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace extensions | 135 } // namespace extensions |
| OLD | NEW |