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

Side by Side Diff: chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc

Issue 1610823003: Migrate call sites LoginDisplayHostImpl::default_host to LoginDisplayHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-add-supervised-user
Patch Set: Address comments Created 4 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 16 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
17 #include "chrome/browser/chromeos/policy/device_policy_builder.h" 17 #include "chrome/browser/chromeos/policy/device_policy_builder.h"
18 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 18 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
19 #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h" 19 #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h"
20 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 20 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
21 #include "chrome/browser/chromeos/settings/cros_settings.h" 21 #include "chrome/browser/chromeos/settings/cros_settings.h"
22 #include "chrome/browser/lifetime/application_lifetime.h" 22 #include "chrome/browser/lifetime/application_lifetime.h"
23 #include "chrome/test/base/in_process_browser_test.h" 23 #include "chrome/test/base/in_process_browser_test.h"
24 #include "chromeos/chromeos_switches.h" 24 #include "chromeos/chromeos_switches.h"
25 #include "chromeos/dbus/cryptohome_client.h" 25 #include "chromeos/dbus/cryptohome_client.h"
26 #include "chromeos/dbus/dbus_thread_manager.h" 26 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 void SetUpInProcessBrowserTestFixture() override { 81 void SetUpInProcessBrowserTestFixture() override {
82 InstallOwnerKey(); 82 InstallOwnerKey();
83 MarkAsEnterpriseOwned(); 83 MarkAsEnterpriseOwned();
84 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture(); 84 DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture();
85 } 85 }
86 86
87 void TearDownOnMainThread() override { 87 void TearDownOnMainThread() override {
88 // If the login display is still showing, exit gracefully. 88 // If the login display is still showing, exit gracefully.
89 if (chromeos::LoginDisplayHostImpl::default_host()) { 89 if (chromeos::LoginDisplayHost::default_host()) {
90 base::MessageLoop::current()->PostTask(FROM_HERE, 90 base::MessageLoop::current()->PostTask(FROM_HERE,
91 base::Bind(&chrome::AttemptExit)); 91 base::Bind(&chrome::AttemptExit));
92 content::RunMessageLoop(); 92 content::RunMessageLoop();
93 } 93 }
94 } 94 }
95 95
96 protected: 96 protected:
97 void SetPolicy(int rotation) { 97 void SetPolicy(int rotation) {
98 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 98 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
99 proto.mutable_display_rotation_default()->set_display_rotation_default( 99 proto.mutable_display_rotation_default()->set_display_rotation_default(
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 322
323 INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault, 323 INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault,
324 DisplayRotationBootTest, 324 DisplayRotationBootTest,
325 testing::Values(gfx::Display::ROTATE_0, 325 testing::Values(gfx::Display::ROTATE_0,
326 gfx::Display::ROTATE_90, 326 gfx::Display::ROTATE_90,
327 gfx::Display::ROTATE_180, 327 gfx::Display::ROTATE_180,
328 gfx::Display::ROTATE_270)); 328 gfx::Display::ROTATE_270));
329 329
330 } // namespace policy 330 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698