| OLD | NEW |
| 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 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 blacklist.Append(base::Value::CreateStringValue(folder_path)); | 1787 blacklist.Append(base::Value::CreateStringValue(folder_path)); |
| 1788 policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, | 1788 policies.Set(key::kURLBlacklist, POLICY_LEVEL_MANDATORY, |
| 1789 POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); | 1789 POLICY_SCOPE_USER, blacklist.DeepCopy(), NULL); |
| 1790 UpdateProviderPolicy(policies); | 1790 UpdateProviderPolicy(policies); |
| 1791 FlushBlacklistPolicy(); | 1791 FlushBlacklistPolicy(); |
| 1792 | 1792 |
| 1793 CheckCanOpenURL(browser(), file_path1.c_str()); | 1793 CheckCanOpenURL(browser(), file_path1.c_str()); |
| 1794 CheckURLIsBlocked(browser(), file_path2.c_str()); | 1794 CheckURLIsBlocked(browser(), file_path2.c_str()); |
| 1795 } | 1795 } |
| 1796 | 1796 |
| 1797 #if !defined(OS_MACOSX) |
| 1798 IN_PROC_BROWSER_TEST_F(PolicyTest, FullscreenAllowed) { |
| 1799 PolicyMap policies; |
| 1800 policies.Set(key::kFullscreenAllowed, |
| 1801 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
| 1802 base::Value::CreateBooleanValue(false), NULL); |
| 1803 UpdateProviderPolicy(policies); |
| 1804 |
| 1805 BrowserWindow* browser_window = browser()->window(); |
| 1806 ASSERT_TRUE(browser_window); |
| 1807 |
| 1808 EXPECT_FALSE(browser_window->IsFullscreen()); |
| 1809 chrome::ToggleFullscreenMode(browser()); |
| 1810 EXPECT_FALSE(browser_window->IsFullscreen()); |
| 1811 } |
| 1812 #endif |
| 1813 |
| 1797 #if defined(OS_CHROMEOS) | 1814 #if defined(OS_CHROMEOS) |
| 1798 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableScreenshotsFile) { | 1815 IN_PROC_BROWSER_TEST_F(PolicyTest, DisableScreenshotsFile) { |
| 1799 int screenshot_count = CountScreenshots(); | 1816 int screenshot_count = CountScreenshots(); |
| 1800 | 1817 |
| 1801 // Make sure screenshots are counted correctly. | 1818 // Make sure screenshots are counted correctly. |
| 1802 TestScreenshotFile(true); | 1819 TestScreenshotFile(true); |
| 1803 ASSERT_EQ(CountScreenshots(), screenshot_count + 1); | 1820 ASSERT_EQ(CountScreenshots(), screenshot_count + 1); |
| 1804 | 1821 |
| 1805 // Check if trying to take a screenshot fails when disabled by policy. | 1822 // Check if trying to take a screenshot fails when disabled by policy. |
| 1806 TestScreenshotFile(false); | 1823 TestScreenshotFile(false); |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2485 chrome_variations::VariationsService::GetVariationsServerURL( | 2502 chrome_variations::VariationsService::GetVariationsServerURL( |
| 2486 g_browser_process->local_state()); | 2503 g_browser_process->local_state()); |
| 2487 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2504 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
| 2488 std::string value; | 2505 std::string value; |
| 2489 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2506 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
| 2490 EXPECT_EQ("restricted", value); | 2507 EXPECT_EQ("restricted", value); |
| 2491 } | 2508 } |
| 2492 #endif | 2509 #endif |
| 2493 | 2510 |
| 2494 } // namespace policy | 2511 } // namespace policy |
| OLD | NEW |