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

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

Issue 2445583002: Relocate display_manager from ash to ui (Closed)
Patch Set: 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 #include "net/test/url_request/url_request_mock_http_job.h" 180 #include "net/test/url_request/url_request_mock_http_job.h"
182 #include "net/url_request/url_request.h" 181 #include "net/url_request/url_request.h"
183 #include "net/url_request/url_request_filter.h" 182 #include "net/url_request/url_request_filter.h"
184 #include "net/url_request/url_request_interceptor.h" 183 #include "net/url_request/url_request_interceptor.h"
185 #include "testing/gmock/include/gmock/gmock.h" 184 #include "testing/gmock/include/gmock/gmock.h"
186 #include "testing/gtest/include/gtest/gtest.h" 185 #include "testing/gtest/include/gtest/gtest.h"
187 #include "third_party/WebKit/public/web/WebInputEvent.h" 186 #include "third_party/WebKit/public/web/WebInputEvent.h"
188 #include "ui/base/l10n/l10n_util.h" 187 #include "ui/base/l10n/l10n_util.h"
189 #include "ui/base/page_transition_types.h" 188 #include "ui/base/page_transition_types.h"
190 #include "ui/base/resource/resource_bundle.h" 189 #include "ui/base/resource/resource_bundle.h"
190 #include "ui/display/manager/display_manager.h"
191 #include "url/gurl.h" 191 #include "url/gurl.h"
192 #include "url/origin.h" 192 #include "url/origin.h"
193 193
194 #if defined(OS_CHROMEOS) 194 #if defined(OS_CHROMEOS)
195 #include "ash/common/accelerators/accelerator_controller.h" 195 #include "ash/common/accelerators/accelerator_controller.h"
196 #include "ash/common/accelerators/accelerator_table.h" 196 #include "ash/common/accelerators/accelerator_table.h"
197 #include "ash/common/accessibility_types.h" 197 #include "ash/common/accessibility_types.h"
198 #include "ash/common/wm_shell.h" 198 #include "ash/common/wm_shell.h"
199 #include "ash/shell.h" 199 #include "ash/shell.h"
200 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 200 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
(...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after
4137 // Verifies that hardware acceleration can be disabled with policy. 4137 // Verifies that hardware acceleration can be disabled with policy.
4138 EXPECT_FALSE( 4138 EXPECT_FALSE(
4139 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); 4139 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr));
4140 } 4140 }
4141 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 4141 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
4142 4142
4143 #if defined(OS_CHROMEOS) 4143 #if defined(OS_CHROMEOS)
4144 // Policy is only available in ChromeOS 4144 // Policy is only available in ChromeOS
4145 IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) { 4145 IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) {
4146 // Verify that Unified Desktop can be enabled by policy 4146 // Verify that Unified Desktop can be enabled by policy
4147 ash::DisplayManager *display_manager = 4147 display::DisplayManager* display_manager =
4148 ash::Shell::GetInstance()->display_manager(); 4148 ash::Shell::GetInstance()->display_manager();
4149 4149
4150 // The policy description promises that Unified Desktop is not available 4150 // The policy description promises that Unified Desktop is not available
4151 // unless the policy is set (or a command line or an extension is used). If 4151 // unless the policy is set (or a command line or an extension is used). If
4152 // this default behaviour changes, please change the description at 4152 // this default behaviour changes, please change the description at
4153 // components/policy/resources/policy_templates.json. 4153 // components/policy/resources/policy_templates.json.
4154 EXPECT_FALSE(display_manager->unified_desktop_enabled()); 4154 EXPECT_FALSE(display_manager->unified_desktop_enabled());
4155 // Now set the policy and check that unified desktop is turned on. 4155 // Now set the policy and check that unified desktop is turned on.
4156 PolicyMap policies; 4156 PolicyMap policies;
4157 policies.Set(key::kUnifiedDesktopEnabledByDefault, POLICY_LEVEL_MANDATORY, 4157 policies.Set(key::kUnifiedDesktopEnabledByDefault, POLICY_LEVEL_MANDATORY,
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4490 4490
4491 SetEmptyPolicy(); 4491 SetEmptyPolicy();
4492 // Policy not set. 4492 // Policy not set.
4493 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4493 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4494 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4494 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4495 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4495 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4496 } 4496 }
4497 #endif // defined(OS_CHROMEOS) 4497 #endif // defined(OS_CHROMEOS)
4498 4498
4499 } // namespace policy 4499 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698