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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 22986010: Add policy for fullscreen mode; disallow fullscreen in public sessions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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) 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 blacklist.Append(base::Value::CreateStringValue(folder_path)); 1780 blacklist.Append(base::Value::CreateStringValue(folder_path));
1781 policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, 1781 policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY,
1782 POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); 1782 POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL);
1783 UpdateProviderPolicy(policies); 1783 UpdateProviderPolicy(policies);
1784 FlushBlacklistPolicy(); 1784 FlushBlacklistPolicy();
1785 1785
1786 CheckCanOpenURL(browser(), file_path1.c_str()); 1786 CheckCanOpenURL(browser(), file_path1.c_str());
1787 CheckURLIsBlocked(browser(), file_path2.c_str()); 1787 CheckURLIsBlocked(browser(), file_path2.c_str());
1788 } 1788 }
1789 1789
1790 IN_PROC_BROWSER_TEST_F(PolicyTest, AllowFullscreen) {
1791 PolicyMap policies;
1792 policies.Set(key::kAllowFullscreen,
1793 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
1794 base::Value::CreateBooleanValue(false), NULL);
1795 UpdateProviderPolicy(policies);
1796
1797 BrowserWindow* browser_window = browser()->window();
1798 ASSERT_TRUE(browser_window);
1799
1800 EXPECT_FALSE(browser_window->IsFullscreen());
1801 chrome::ToggleFullscreenMode(browser());
1802 EXPECT_FALSE(browser_window->IsFullscreen());
1803 }
1804
1790 #if defined(OS_CHROMEOS) 1805 #if defined(OS_CHROMEOS)
1791 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableScreenshotsFile) { 1806 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableScreenshotsFile) {
1792 int screenshot_count = CountScreenshots(); 1807 int screenshot_count = CountScreenshots();
1793 1808
1794 // Make sure screenshots are counted correctly. 1809 // Make sure screenshots are counted correctly.
1795 TestScreenshotFile(true); 1810 TestScreenshotFile(true);
1796 ASSERT_EQ(CountScreenshots(), screenshot_count + 1); 1811 ASSERT_EQ(CountScreenshots(), screenshot_count + 1);
1797 1812
1798 // Check if trying to take a screenshot fails when disabled by policy. 1813 // Check if trying to take a screenshot fails when disabled by policy.
1799 TestScreenshotFile(false); 1814 TestScreenshotFile(false);
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 chrome_variations::VariationsService::GetVariationsServerURL( 2493 chrome_variations::VariationsService::GetVariationsServerURL(
2479 g_browser_process->local_state()); 2494 g_browser_process->local_state());
2480 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); 2495 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true));
2481 std::string value; 2496 std::string value;
2482 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); 2497 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
2483 EXPECT_EQ("restricted", value); 2498 EXPECT_EQ("restricted", value);
2484 } 2499 }
2485 #endif 2500 #endif
2486 2501
2487 } // namespace policy 2502 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698