OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/content_settings/content_settings_mock_provider.h" | 8 #include "chrome/browser/content_settings/content_settings_mock_provider.h" |
9 #include "chrome/browser/content_settings/content_settings_utils.h" | 9 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 10 #include "chrome/common/chrome_content_settings_client.h" |
10 #include "url/gurl.h" | 11 #include "url/gurl.h" |
11 | 12 |
12 namespace content_settings { | 13 namespace content_settings { |
13 | 14 |
14 TEST(ContentSettingsProviderTest, Mock) { | 15 TEST(ContentSettingsProviderTest, Mock) { |
| 16 content_settings::ChromeContentSettingsClient client; |
15 ContentSettingsPattern pattern = | 17 ContentSettingsPattern pattern = |
16 ContentSettingsPattern::FromString("[*.]youtube.com"); | 18 ContentSettingsPattern::FromString(&client, "[*.]youtube.com"); |
17 GURL url("http://www.youtube.com"); | 19 GURL url("http://www.youtube.com"); |
18 | 20 |
19 MockProvider mock_provider(false); | 21 MockProvider mock_provider(false); |
20 mock_provider.SetWebsiteSetting( | 22 mock_provider.SetWebsiteSetting( |
21 pattern, | 23 pattern, |
22 pattern, | 24 pattern, |
23 CONTENT_SETTINGS_TYPE_PLUGINS, | 25 CONTENT_SETTINGS_TYPE_PLUGINS, |
24 "java_plugin", | 26 "java_plugin", |
25 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); | 27 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); |
26 | 28 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 "java_plugin", | 98 "java_plugin", |
97 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); | 99 new base::FundamentalValue(CONTENT_SETTING_BLOCK)); |
98 EXPECT_TRUE(owned); | 100 EXPECT_TRUE(owned); |
99 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 101 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
100 GetContentSetting(&mock_provider, url, url, | 102 GetContentSetting(&mock_provider, url, url, |
101 CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin", | 103 CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin", |
102 false)); | 104 false)); |
103 } | 105 } |
104 | 106 |
105 } // namespace content_settings | 107 } // namespace content_settings |
OLD | NEW |