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

Side by Side Diff: chrome/browser/content_settings/content_settings_provider_unittest.cc

Issue 8804016: Cleanup content settings code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add deleted include in host_content_settings_map.cc Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 11
12 namespace content_settings { 12 namespace content_settings {
13 13
14 TEST(ContentSettingsProviderTest, Mock) { 14 TEST(ContentSettingsProviderTest, Mock) {
15 ContentSettingsPattern pattern = 15 ContentSettingsPattern pattern =
16 ContentSettingsPattern::FromString("[*.]youtube.com"); 16 ContentSettingsPattern::FromString("[*.]youtube.com");
17 GURL url("http://www.youtube.com"); 17 GURL url("http://www.youtube.com");
18 18
19 MockProvider mock_provider( 19 MockProvider mock_provider(false);
20 mock_provider.SetWebsiteSetting(
20 pattern, 21 pattern,
21 pattern, 22 pattern,
22 CONTENT_SETTINGS_TYPE_PLUGINS, 23 CONTENT_SETTINGS_TYPE_PLUGINS,
23 "java_plugin", 24 "java_plugin",
24 CONTENT_SETTING_BLOCK, 25 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
25 false, 26
26 false);
27 27
28 EXPECT_EQ(CONTENT_SETTING_BLOCK, 28 EXPECT_EQ(CONTENT_SETTING_BLOCK,
29 GetContentSetting(&mock_provider, url, url, 29 GetContentSetting(&mock_provider, url, url,
30 CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin", 30 CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin",
31 false)); 31 false));
32 scoped_ptr<Value> value_ptr( 32 scoped_ptr<Value> value_ptr(
33 GetContentSettingValue(&mock_provider, url, url, 33 GetContentSettingValue(&mock_provider, url, url,
34 CONTENT_SETTINGS_TYPE_PLUGINS, 34 CONTENT_SETTINGS_TYPE_PLUGINS,
35 "java_plugin", false)); 35 "java_plugin", false));
36 int int_value = -1; 36 int int_value = -1;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 "java_plugin", 90 "java_plugin",
91 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); 91 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
92 EXPECT_TRUE(owned); 92 EXPECT_TRUE(owned);
93 EXPECT_EQ(CONTENT_SETTING_BLOCK, 93 EXPECT_EQ(CONTENT_SETTING_BLOCK,
94 GetContentSetting(&mock_provider, url, url, 94 GetContentSetting(&mock_provider, url, url,
95 CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin", 95 CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin",
96 false)); 96 false));
97 } 97 }
98 98
99 } // namespace content_settings 99 } // namespace content_settings
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_provider.h ('k') | chrome/browser/content_settings/content_settings_rule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698