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

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

Issue 9293010: Merge 119773 - Move click-to-play out of chrome://flags. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/src
Patch Set: '' Created 8 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) 2011 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.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/content_settings/content_settings_details.h" 10 #include "chrome/browser/content_settings/content_settings_details.h"
11 #include "chrome/browser/content_settings/cookie_settings.h" 11 #include "chrome/browser/content_settings/cookie_settings.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Click-to-play needs to be enabled to set the content setting to ASK.
61 CommandLine* cmd = CommandLine::ForCurrentProcess();
62 AutoReset<CommandLine> auto_reset(cmd, *cmd);
63 cmd->AppendSwitch(switches::kEnableClickToPlay);
64
65 host_content_settings_map->SetDefaultContentSetting( 60 host_content_settings_map->SetDefaultContentSetting(
66 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ASK); 61 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ASK);
67 EXPECT_EQ(CONTENT_SETTING_ASK, 62 EXPECT_EQ(CONTENT_SETTING_ASK,
68 host_content_settings_map->GetDefaultContentSetting( 63 host_content_settings_map->GetDefaultContentSetting(
69 CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); 64 CONTENT_SETTINGS_TYPE_PLUGINS, NULL));
70 } 65 }
71 host_content_settings_map->SetDefaultContentSetting( 66 host_content_settings_map->SetDefaultContentSetting(
72 CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW); 67 CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW);
73 EXPECT_EQ(CONTENT_SETTING_ALLOW, 68 EXPECT_EQ(CONTENT_SETTING_ALLOW,
74 host_content_settings_map->GetDefaultContentSetting( 69 host_content_settings_map->GetDefaultContentSetting(
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 CONTENT_SETTINGS_TYPE_IMAGES, 1050 CONTENT_SETTINGS_TYPE_IMAGES,
1056 std::string(), 1051 std::string(),
1057 CONTENT_SETTING_BLOCK); 1052 CONTENT_SETTING_BLOCK);
1058 EXPECT_EQ(CONTENT_SETTING_BLOCK, 1053 EXPECT_EQ(CONTENT_SETTING_BLOCK,
1059 host_content_settings_map->GetContentSetting( 1054 host_content_settings_map->GetContentSetting(
1060 host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); 1055 host, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
1061 EXPECT_EQ(CONTENT_SETTING_ALLOW, 1056 EXPECT_EQ(CONTENT_SETTING_ALLOW,
1062 host_content_settings_map->GetContentSetting( 1057 host_content_settings_map->GetContentSetting(
1063 embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); 1058 embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
1064 } 1059 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698