| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 5 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 DevicePolicyCrosBrowserTest::DevicePolicyCrosBrowserTest() | 80 DevicePolicyCrosBrowserTest::DevicePolicyCrosBrowserTest() |
| 81 : fake_session_manager_client_(new chromeos::FakeSessionManagerClient) { | 81 : fake_session_manager_client_(new chromeos::FakeSessionManagerClient) { |
| 82 } | 82 } |
| 83 | 83 |
| 84 DevicePolicyCrosBrowserTest::~DevicePolicyCrosBrowserTest() { | 84 DevicePolicyCrosBrowserTest::~DevicePolicyCrosBrowserTest() { |
| 85 } | 85 } |
| 86 | 86 |
| 87 void DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture() { | 87 void DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture() { |
| 88 InstallOwnerKey(); |
| 89 MarkAsEnterpriseOwned(); |
| 88 dbus_setter_ = chromeos::DBusThreadManager::GetSetterForTesting(); | 90 dbus_setter_ = chromeos::DBusThreadManager::GetSetterForTesting(); |
| 89 dbus_setter_->SetSessionManagerClient( | 91 dbus_setter_->SetSessionManagerClient( |
| 90 std::unique_ptr<chromeos::SessionManagerClient>( | 92 std::unique_ptr<chromeos::SessionManagerClient>( |
| 91 fake_session_manager_client_)); | 93 fake_session_manager_client_)); |
| 92 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 94 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 93 } | 95 } |
| 94 | 96 |
| 95 void DevicePolicyCrosBrowserTest::TearDownInProcessBrowserTestFixture() { | 97 void DevicePolicyCrosBrowserTest::TearDownInProcessBrowserTestFixture() { |
| 96 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); | 98 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); |
| 97 } | 99 } |
| 98 | 100 |
| 99 void DevicePolicyCrosBrowserTest::MarkAsEnterpriseOwned() { | 101 void DevicePolicyCrosBrowserTest::MarkAsEnterpriseOwned() { |
| 100 test_helper_.MarkAsEnterpriseOwned(); | 102 test_helper_.MarkAsEnterpriseOwned(); |
| 101 } | 103 } |
| 102 | 104 |
| 103 void DevicePolicyCrosBrowserTest::InstallOwnerKey() { | 105 void DevicePolicyCrosBrowserTest::InstallOwnerKey() { |
| 104 test_helper_.InstallOwnerKey(); | 106 test_helper_.InstallOwnerKey(); |
| 105 } | 107 } |
| 106 | 108 |
| 107 void DevicePolicyCrosBrowserTest::RefreshDevicePolicy() { | 109 void DevicePolicyCrosBrowserTest::RefreshDevicePolicy() { |
| 108 // Reset the key to its original state. | 110 // Reset the key to its original state. |
| 109 device_policy()->SetDefaultSigningKey(); | 111 device_policy()->SetDefaultSigningKey(); |
| 110 device_policy()->Build(); | 112 device_policy()->Build(); |
| 111 session_manager_client()->set_device_policy(device_policy()->GetBlob()); | 113 session_manager_client()->set_device_policy(device_policy()->GetBlob()); |
| 112 session_manager_client()->OnPropertyChangeComplete(true); | 114 session_manager_client()->OnPropertyChangeComplete(true); |
| 113 } | 115 } |
| 114 | 116 |
| 115 } // namespace policy | 117 } // namespace policy |
| OLD | NEW |