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

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

Issue 6542048: Add content_settings::PolicyProvider and a set of new policies to managed content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 10 months 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/content_settings/content_settings_mock_provider.h" 7 #include "chrome/browser/content_settings/content_settings_mock_provider.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 9
10 namespace content_settings { 10 namespace content_settings {
(...skipping 16 matching lines...) Expand all
27 27
28 ContentSettingsPattern pattern("[*.]youtube.com"); 28 ContentSettingsPattern pattern("[*.]youtube.com");
29 GURL url("http://www.youtube.com"); 29 GURL url("http://www.youtube.com");
30 30
31 MockProvider mock_provider( 31 MockProvider mock_provider(
32 pattern, 32 pattern,
33 pattern, 33 pattern,
34 CONTENT_SETTINGS_TYPE_PLUGINS, 34 CONTENT_SETTINGS_TYPE_PLUGINS,
35 "java_plugin", 35 "java_plugin",
36 CONTENT_SETTING_BLOCK, 36 CONTENT_SETTING_BLOCK,
37 false,
37 false); 38 false);
39
38 EXPECT_EQ(CONTENT_SETTING_BLOCK, mock_provider.GetContentSetting( 40 EXPECT_EQ(CONTENT_SETTING_BLOCK, mock_provider.GetContentSetting(
39 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin")); 41 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin"));
40 EXPECT_EQ(CONTENT_SETTING_DEFAULT, mock_provider.GetContentSetting( 42 EXPECT_EQ(CONTENT_SETTING_DEFAULT, mock_provider.GetContentSetting(
41 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "flash_plugin")); 43 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "flash_plugin"));
42 EXPECT_EQ(CONTENT_SETTING_DEFAULT, mock_provider.GetContentSetting( 44 EXPECT_EQ(CONTENT_SETTING_DEFAULT, mock_provider.GetContentSetting(
43 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, "")); 45 url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, ""));
44 46
45 mock_provider.SetContentSetting( 47 mock_provider.SetContentSetting(
46 pattern, 48 pattern,
47 pattern, 49 pattern,
(...skipping 13 matching lines...) Expand all
61 EXPECT_EQ(CONTENT_SETTING_ALLOW, mock_provider.GetContentSetting( 63 EXPECT_EQ(CONTENT_SETTING_ALLOW, mock_provider.GetContentSetting(
62 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin")); 64 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin"));
63 65
64 EXPECT_TRUE(mock_provider.read_only()); 66 EXPECT_TRUE(mock_provider.read_only());
65 mock_provider.set_setting(CONTENT_SETTING_BLOCK); 67 mock_provider.set_setting(CONTENT_SETTING_BLOCK);
66 EXPECT_EQ(CONTENT_SETTING_BLOCK, mock_provider.GetContentSetting( 68 EXPECT_EQ(CONTENT_SETTING_BLOCK, mock_provider.GetContentSetting(
67 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin")); 69 url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "java_plugin"));
68 } 70 }
69 71
70 } // namespace content_settings 72 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698