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

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

Issue 2445583002: Relocate display_manager from ash to ui (Closed)
Patch Set: fix windows build 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 14 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
15 #include "ash/display/display_manager.h"
16 #include "base/bind.h" 15 #include "base/bind.h"
17 #include "base/bind_helpers.h" 16 #include "base/bind_helpers.h"
18 #include "base/callback.h" 17 #include "base/callback.h"
19 #include "base/callback_helpers.h" 18 #include "base/callback_helpers.h"
20 #include "base/command_line.h" 19 #include "base/command_line.h"
21 #include "base/files/file_enumerator.h" 20 #include "base/files/file_enumerator.h"
22 #include "base/files/file_path.h" 21 #include "base/files/file_path.h"
23 #include "base/files/file_util.h" 22 #include "base/files/file_util.h"
24 #include "base/files/scoped_temp_dir.h" 23 #include "base/files/scoped_temp_dir.h"
25 #include "base/macros.h" 24 #include "base/macros.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 #include "net/test/url_request/url_request_mock_http_job.h" 175 #include "net/test/url_request/url_request_mock_http_job.h"
177 #include "net/url_request/url_request.h" 176 #include "net/url_request/url_request.h"
178 #include "net/url_request/url_request_filter.h" 177 #include "net/url_request/url_request_filter.h"
179 #include "net/url_request/url_request_interceptor.h" 178 #include "net/url_request/url_request_interceptor.h"
180 #include "testing/gmock/include/gmock/gmock.h" 179 #include "testing/gmock/include/gmock/gmock.h"
181 #include "testing/gtest/include/gtest/gtest.h" 180 #include "testing/gtest/include/gtest/gtest.h"
182 #include "third_party/WebKit/public/web/WebInputEvent.h" 181 #include "third_party/WebKit/public/web/WebInputEvent.h"
183 #include "ui/base/l10n/l10n_util.h" 182 #include "ui/base/l10n/l10n_util.h"
184 #include "ui/base/page_transition_types.h" 183 #include "ui/base/page_transition_types.h"
185 #include "ui/base/resource/resource_bundle.h" 184 #include "ui/base/resource/resource_bundle.h"
185 #include "ui/display/manager/display_manager.h"
186 #include "url/gurl.h" 186 #include "url/gurl.h"
187 #include "url/origin.h" 187 #include "url/origin.h"
188 188
189 #if defined(OS_CHROMEOS) 189 #if defined(OS_CHROMEOS)
190 #include "ash/common/accelerators/accelerator_controller.h" 190 #include "ash/common/accelerators/accelerator_controller.h"
191 #include "ash/common/accelerators/accelerator_table.h" 191 #include "ash/common/accelerators/accelerator_table.h"
192 #include "ash/common/accessibility_types.h" 192 #include "ash/common/accessibility_types.h"
193 #include "ash/common/wm_shell.h" 193 #include "ash/common/wm_shell.h"
194 #include "ash/shell.h" 194 #include "ash/shell.h"
195 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 195 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
(...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after
3915 // Verifies that hardware acceleration can be disabled with policy. 3915 // Verifies that hardware acceleration can be disabled with policy.
3916 EXPECT_FALSE( 3916 EXPECT_FALSE(
3917 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); 3917 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr));
3918 } 3918 }
3919 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 3919 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
3920 3920
3921 #if defined(OS_CHROMEOS) 3921 #if defined(OS_CHROMEOS)
3922 // Policy is only available in ChromeOS 3922 // Policy is only available in ChromeOS
3923 IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) { 3923 IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) {
3924 // Verify that Unified Desktop can be enabled by policy 3924 // Verify that Unified Desktop can be enabled by policy
3925 ash::DisplayManager *display_manager = 3925 display::DisplayManager* display_manager =
3926 ash::Shell::GetInstance()->display_manager(); 3926 ash::Shell::GetInstance()->display_manager();
3927 3927
3928 // The policy description promises that Unified Desktop is not available 3928 // The policy description promises that Unified Desktop is not available
3929 // unless the policy is set (or a command line or an extension is used). If 3929 // unless the policy is set (or a command line or an extension is used). If
3930 // this default behaviour changes, please change the description at 3930 // this default behaviour changes, please change the description at
3931 // components/policy/resources/policy_templates.json. 3931 // components/policy/resources/policy_templates.json.
3932 EXPECT_FALSE(display_manager->unified_desktop_enabled()); 3932 EXPECT_FALSE(display_manager->unified_desktop_enabled());
3933 // Now set the policy and check that unified desktop is turned on. 3933 // Now set the policy and check that unified desktop is turned on.
3934 PolicyMap policies; 3934 PolicyMap policies;
3935 policies.Set(key::kUnifiedDesktopEnabledByDefault, POLICY_LEVEL_MANDATORY, 3935 policies.Set(key::kUnifiedDesktopEnabledByDefault, POLICY_LEVEL_MANDATORY,
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4268 4268
4269 SetEmptyPolicy(); 4269 SetEmptyPolicy();
4270 // Policy not set. 4270 // Policy not set.
4271 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4271 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4272 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4272 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4273 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4273 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4274 } 4274 }
4275 #endif // defined(OS_CHROMEOS) 4275 #endif // defined(OS_CHROMEOS)
4276 4276
4277 } // namespace policy 4277 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698