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

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

Issue 2419413002: Deleted CONTENT_SETTINGS_TYPE_FULLSCREEN and MOUSELOCK. (Closed)
Patch Set: Fix more things. Created 4 years, 1 month 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/content_settings/host_content_settings_map_factory.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_commands.h" 7 #include "chrome/browser/ui/browser_commands.h"
8 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
(...skipping 24 matching lines...) Expand all
35 FILE_PATH_LITERAL("empty.html"); 35 FILE_PATH_LITERAL("empty.html");
36 GURL file_url(ui_test_utils::GetTestUrl( 36 GURL file_url(ui_test_utils::GetTestUrl(
37 base::FilePath(base::FilePath::kCurrentDirectory), 37 base::FilePath(base::FilePath::kCurrentDirectory),
38 base::FilePath(kEmptyFile))); 38 base::FilePath(kEmptyFile)));
39 AddTabAtIndex(0, file_url, PAGE_TRANSITION_TYPED); 39 AddTabAtIndex(0, file_url, PAGE_TRANSITION_TYPED);
40 GetFullscreenController()->EnterFullscreenModeForTab( 40 GetFullscreenController()->EnterFullscreenModeForTab(
41 browser()->tab_strip_model()->GetActiveWebContents(), 41 browser()->tab_strip_model()->GetActiveWebContents(),
42 file_url.GetOrigin()); 42 file_url.GetOrigin());
43 ASSERT_TRUE(IsFullscreenBubbleDisplayed()); 43 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
44 } 44 }
45
46 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, PermissionContentSettings) {
47 ASSERT_TRUE(embedded_test_server()->Start());
48 GURL url = embedded_test_server()->GetURL(kFullscreenMouseLockHTML);
49 ui_test_utils::NavigateToURL(browser(), url);
50
51 EXPECT_FALSE(browser()->window()->IsFullscreen());
52
53 // The content's origin is not allowed to go fullscreen.
54 EXPECT_EQ(
55 CONTENT_SETTING_ASK,
56 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
57 ->GetContentSetting(url.GetOrigin(),
58 url.GetOrigin(),
59 CONTENT_SETTINGS_TYPE_FULLSCREEN,
60 std::string()));
61
62 GetFullscreenController()->EnterFullscreenModeForTab(
63 browser()->tab_strip_model()->GetActiveWebContents(), url.GetOrigin());
64 EXPECT_TRUE(IsFullscreenBubbleDisplayed());
65
66 // The content's origin is still not allowed to go fullscreen.
67 EXPECT_EQ(
68 CONTENT_SETTING_ASK,
69 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
70 ->GetContentSetting(url.GetOrigin(),
71 url.GetOrigin(),
72 CONTENT_SETTINGS_TYPE_FULLSCREEN,
73 std::string()));
74
75 // The primary and secondary patterns have been set when setting the
76 // permission, thus setting another secondary pattern shouldn't work.
77 EXPECT_EQ(
78 CONTENT_SETTING_ASK,
79 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
80 ->GetContentSetting(url.GetOrigin(),
81 GURL("https://test.com"),
82 CONTENT_SETTINGS_TYPE_FULLSCREEN,
83 std::string()));
84
85 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
86 ->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_FULLSCREEN);
87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698