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

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

Issue 796543002: Plugin Power Saver: Implement option in Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "Fix" a browser test by disabling it. Fix a nit. Created 6 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 host_content_settings_map->SetDefaultContentSetting( 49 host_content_settings_map->SetDefaultContentSetting(
50 CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK); 50 CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK);
51 EXPECT_EQ(CONTENT_SETTING_BLOCK, 51 EXPECT_EQ(CONTENT_SETTING_BLOCK,
52 host_content_settings_map->GetDefaultContentSetting( 52 host_content_settings_map->GetDefaultContentSetting(
53 CONTENT_SETTINGS_TYPE_IMAGES, NULL)); 53 CONTENT_SETTINGS_TYPE_IMAGES, NULL));
54 EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( 54 EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting(
55 GURL(chrome::kChromeUINewTabURL), 55 GURL(chrome::kChromeUINewTabURL),
56 GURL(chrome::kChromeUINewTabURL), 56 GURL(chrome::kChromeUINewTabURL),
57 CONTENT_SETTINGS_TYPE_IMAGES, 57 CONTENT_SETTINGS_TYPE_IMAGES,
58 std::string())); 58 std::string()));
59 { 59
60 host_content_settings_map->SetDefaultContentSetting( 60 host_content_settings_map->SetDefaultContentSetting(
61 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ASK); 61 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ALLOW);
62 EXPECT_EQ(CONTENT_SETTING_ASK, 62 EXPECT_EQ(CONTENT_SETTING_ALLOW,
63 host_content_settings_map->GetDefaultContentSetting( 63 host_content_settings_map->GetDefaultContentSetting(
64 CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); 64 CONTENT_SETTINGS_TYPE_PLUGINS, NULL));
65 } 65 host_content_settings_map->SetDefaultContentSetting(
66 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
67 EXPECT_EQ(CONTENT_SETTING_BLOCK,
68 host_content_settings_map->GetDefaultContentSetting(
69 CONTENT_SETTINGS_TYPE_PLUGINS, NULL));
70 host_content_settings_map->SetDefaultContentSetting(
71 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_DETECT_IMPORTANT_CONTENT);
72 EXPECT_EQ(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
73 host_content_settings_map->GetDefaultContentSetting(
74 CONTENT_SETTINGS_TYPE_PLUGINS, NULL));
75
66 host_content_settings_map->SetDefaultContentSetting( 76 host_content_settings_map->SetDefaultContentSetting(
67 CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW); 77 CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW);
68 EXPECT_EQ(CONTENT_SETTING_ALLOW, 78 EXPECT_EQ(CONTENT_SETTING_ALLOW,
69 host_content_settings_map->GetDefaultContentSetting( 79 host_content_settings_map->GetDefaultContentSetting(
70 CONTENT_SETTINGS_TYPE_POPUPS, NULL)); 80 CONTENT_SETTINGS_TYPE_POPUPS, NULL));
71 } 81 }
72 82
73 TEST_F(HostContentSettingsMapTest, IndividualSettings) { 83 TEST_F(HostContentSettingsMapTest, IndividualSettings) {
74 TestingProfile profile; 84 TestingProfile profile;
75 HostContentSettingsMap* host_content_settings_map = 85 HostContentSettingsMap* host_content_settings_map =
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 CONTENT_SETTINGS_TYPE_IMAGES, true); 1040 CONTENT_SETTINGS_TYPE_IMAGES, true);
1031 EXPECT_EQ(CONTENT_SETTING_ALLOW, 1041 EXPECT_EQ(CONTENT_SETTING_ALLOW,
1032 host_content_settings_map->GetContentSetting( 1042 host_content_settings_map->GetContentSetting(
1033 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 1043 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
1034 host_content_settings_map->SetDefaultContentSetting( 1044 host_content_settings_map->SetDefaultContentSetting(
1035 CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK); 1045 CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK);
1036 EXPECT_EQ(CONTENT_SETTING_BLOCK, 1046 EXPECT_EQ(CONTENT_SETTING_BLOCK,
1037 host_content_settings_map->GetContentSetting( 1047 host_content_settings_map->GetContentSetting(
1038 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); 1048 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
1039 } 1049 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698