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

Side by Side Diff: chrome/browser/ui/exclusive_access/fullscreen_controller_browsertest.cc

Issue 1312453005: Removed Profile::GetHostContentSettingsMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed patch conflict Created 5 years, 3 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
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 "chrome/browser/content_settings/host_content_settings_map_factory.h"
5 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
6 #include "chrome/browser/ui/browser_commands.h" 7 #include "chrome/browser/ui/browser_commands.h"
7 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
8 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" 11 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h"
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" 12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
12 #include "chrome/test/base/ui_test_utils.h" 13 #include "chrome/test/base/ui_test_utils.h"
13 #include "components/content_settings/core/browser/host_content_settings_map.h" 14 #include "components/content_settings/core/browser/host_content_settings_map.h"
14 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, PermissionContentSettings) { 97 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, PermissionContentSettings) {
97 GURL url = test_server()->GetURL(kFullscreenMouseLockHTML); 98 GURL url = test_server()->GetURL(kFullscreenMouseLockHTML);
98 ASSERT_TRUE(test_server()->Start()); 99 ASSERT_TRUE(test_server()->Start());
99 ui_test_utils::NavigateToURL(browser(), url); 100 ui_test_utils::NavigateToURL(browser(), url);
100 101
101 EXPECT_FALSE(browser()->window()->IsFullscreen()); 102 EXPECT_FALSE(browser()->window()->IsFullscreen());
102 103
103 // The content's origin is not allowed to go fullscreen. 104 // The content's origin is not allowed to go fullscreen.
104 EXPECT_EQ( 105 EXPECT_EQ(
105 CONTENT_SETTING_ASK, 106 CONTENT_SETTING_ASK,
106 browser()->profile()->GetHostContentSettingsMap()->GetContentSetting( 107 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
107 url.GetOrigin(), 108 ->GetContentSetting(url.GetOrigin(),
108 url.GetOrigin(), 109 url.GetOrigin(),
109 CONTENT_SETTINGS_TYPE_FULLSCREEN, 110 CONTENT_SETTINGS_TYPE_FULLSCREEN,
110 std::string())); 111 std::string()));
111 112
112 GetFullscreenController()->EnterFullscreenModeForTab( 113 GetFullscreenController()->EnterFullscreenModeForTab(
113 browser()->tab_strip_model()->GetActiveWebContents(), url.GetOrigin()); 114 browser()->tab_strip_model()->GetActiveWebContents(), url.GetOrigin());
114 EXPECT_TRUE(IsFullscreenBubbleDisplayed()); 115 EXPECT_TRUE(IsFullscreenBubbleDisplayed());
115 116
116 // The content's origin is still not allowed to go fullscreen. 117 // The content's origin is still not allowed to go fullscreen.
117 EXPECT_EQ( 118 EXPECT_EQ(
118 CONTENT_SETTING_ASK, 119 CONTENT_SETTING_ASK,
119 browser()->profile()->GetHostContentSettingsMap()->GetContentSetting( 120 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
120 url.GetOrigin(), 121 ->GetContentSetting(url.GetOrigin(),
121 url.GetOrigin(), 122 url.GetOrigin(),
122 CONTENT_SETTINGS_TYPE_FULLSCREEN, 123 CONTENT_SETTINGS_TYPE_FULLSCREEN,
123 std::string())); 124 std::string()));
124 125
125 AcceptCurrentFullscreenOrMouseLockRequest(); 126 AcceptCurrentFullscreenOrMouseLockRequest();
126 127
127 // The content's origin is allowed to go fullscreen. 128 // The content's origin is allowed to go fullscreen.
128 EXPECT_EQ( 129 EXPECT_EQ(
129 CONTENT_SETTING_ALLOW, 130 CONTENT_SETTING_ALLOW,
130 browser()->profile()->GetHostContentSettingsMap()->GetContentSetting( 131 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
131 url.GetOrigin(), 132 ->GetContentSetting(url.GetOrigin(),
132 url.GetOrigin(), 133 url.GetOrigin(),
133 CONTENT_SETTINGS_TYPE_FULLSCREEN, 134 CONTENT_SETTINGS_TYPE_FULLSCREEN,
134 std::string())); 135 std::string()));
135 136
136 // The primary and secondary patterns have been set when setting the 137 // The primary and secondary patterns have been set when setting the
137 // permission, thus setting another secondary pattern shouldn't work. 138 // permission, thus setting another secondary pattern shouldn't work.
138 EXPECT_EQ( 139 EXPECT_EQ(
139 CONTENT_SETTING_ASK, 140 CONTENT_SETTING_ASK,
140 browser()->profile()->GetHostContentSettingsMap()->GetContentSetting( 141 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
141 url.GetOrigin(), 142 ->GetContentSetting(url.GetOrigin(),
142 GURL("https://test.com"), 143 GURL("https://test.com"),
143 CONTENT_SETTINGS_TYPE_FULLSCREEN, 144 CONTENT_SETTINGS_TYPE_FULLSCREEN,
144 std::string())); 145 std::string()));
145 146
146 browser()->profile()->GetHostContentSettingsMap()->ClearSettingsForOneType( 147 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
147 CONTENT_SETTINGS_TYPE_FULLSCREEN); 148 ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_FULLSCREEN);
148 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698