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

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

Issue 893543003: Expose the "Fullscreen" content setting to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase over 889893002, added a test. Created 5 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/content_settings/content_settings_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 #else 951 #else
952 EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( 952 EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent(
953 extension, extension, CONTENT_SETTINGS_TYPE_COOKIES)); 953 extension, extension, CONTENT_SETTINGS_TYPE_COOKIES));
954 #endif 954 #endif
955 EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( 955 EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent(
956 extension, extension, CONTENT_SETTINGS_TYPE_PLUGINS)); 956 extension, extension, CONTENT_SETTINGS_TYPE_PLUGINS));
957 EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent( 957 EXPECT_FALSE(HostContentSettingsMap::ShouldAllowAllContent(
958 extension, http_host, CONTENT_SETTINGS_TYPE_COOKIES)); 958 extension, http_host, CONTENT_SETTINGS_TYPE_COOKIES));
959 } 959 }
960 960
961 TEST_F(HostContentSettingsMapTest, IsSettingAllowedForType) {
962 TestingProfile profile;
963 PrefService* prefs = profile.GetPrefs();
964
965 EXPECT_TRUE(HostContentSettingsMap::IsSettingAllowedForType(
966 prefs, CONTENT_SETTING_ASK,
967 CONTENT_SETTINGS_TYPE_FULLSCREEN));
968
969 // TODO(msramek): Add more checks for setting type - setting pairs where
970 // it is not obvious whether or not they are allowed.
971 }
972
961 TEST_F(HostContentSettingsMapTest, AddContentSettingsObserver) { 973 TEST_F(HostContentSettingsMapTest, AddContentSettingsObserver) {
962 TestingProfile profile; 974 TestingProfile profile;
963 HostContentSettingsMap* host_content_settings_map = 975 HostContentSettingsMap* host_content_settings_map =
964 profile.GetHostContentSettingsMap(); 976 profile.GetHostContentSettingsMap();
965 content_settings::MockObserver mock_observer; 977 content_settings::MockObserver mock_observer;
966 978
967 GURL host("http://example.com/"); 979 GURL host("http://example.com/");
968 ContentSettingsPattern pattern = 980 ContentSettingsPattern pattern =
969 ContentSettingsPattern::FromString("[*.]example.com"); 981 ContentSettingsPattern::FromString("[*.]example.com");
970 EXPECT_CALL(mock_observer, 982 EXPECT_CALL(mock_observer,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 CONTENT_SETTINGS_TYPE_IMAGES, true); 1057 CONTENT_SETTINGS_TYPE_IMAGES, true);
1046 EXPECT_EQ(CONTENT_SETTING_ALLOW, 1058 EXPECT_EQ(CONTENT_SETTING_ALLOW,
1047 host_content_settings_map->GetContentSetting( 1059 host_content_settings_map->GetContentSetting(
1048 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 1060 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
1049 host_content_settings_map->SetDefaultContentSetting( 1061 host_content_settings_map->SetDefaultContentSetting(
1050 CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK); 1062 CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK);
1051 EXPECT_EQ(CONTENT_SETTING_BLOCK, 1063 EXPECT_EQ(CONTENT_SETTING_BLOCK,
1052 host_content_settings_map->GetContentSetting( 1064 host_content_settings_map->GetContentSetting(
1053 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 1065 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
1054 } 1066 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/content_settings/content_settings_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698