| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 fake_session_manager_client_(new chromeos::FakeSessionManagerClient) { | 76 fake_session_manager_client_(new chromeos::FakeSessionManagerClient) { |
| 77 fake_dbus_thread_manager_->SetFakeClients(); | 77 fake_dbus_thread_manager_->SetFakeClients(); |
| 78 fake_dbus_thread_manager_->SetSessionManagerClient( | 78 fake_dbus_thread_manager_->SetSessionManagerClient( |
| 79 scoped_ptr<chromeos::SessionManagerClient>(fake_session_manager_client_)); | 79 scoped_ptr<chromeos::SessionManagerClient>(fake_session_manager_client_)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 DevicePolicyCrosBrowserTest::~DevicePolicyCrosBrowserTest() { | 82 DevicePolicyCrosBrowserTest::~DevicePolicyCrosBrowserTest() { |
| 83 } | 83 } |
| 84 | 84 |
| 85 void DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture() { | 85 void DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture() { |
| 86 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager_); | 86 chromeos::DBusThreadManager::SetInstanceForTesting(fake_dbus_thread_manager_); |
| 87 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 87 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void DevicePolicyCrosBrowserTest::TearDownInProcessBrowserTestFixture() { | 90 void DevicePolicyCrosBrowserTest::TearDownInProcessBrowserTestFixture() { |
| 91 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); | 91 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); |
| 92 chromeos::DBusThreadManager::Shutdown(); | |
| 93 } | 92 } |
| 94 | 93 |
| 95 void DevicePolicyCrosBrowserTest::MarkAsEnterpriseOwned() { | 94 void DevicePolicyCrosBrowserTest::MarkAsEnterpriseOwned() { |
| 96 test_helper_.MarkAsEnterpriseOwned(); | 95 test_helper_.MarkAsEnterpriseOwned(); |
| 97 } | 96 } |
| 98 | 97 |
| 99 void DevicePolicyCrosBrowserTest::InstallOwnerKey() { | 98 void DevicePolicyCrosBrowserTest::InstallOwnerKey() { |
| 100 test_helper_.InstallOwnerKey(); | 99 test_helper_.InstallOwnerKey(); |
| 101 } | 100 } |
| 102 | 101 |
| 103 void DevicePolicyCrosBrowserTest::RefreshDevicePolicy() { | 102 void DevicePolicyCrosBrowserTest::RefreshDevicePolicy() { |
| 104 // Reset the key to its original state. | 103 // Reset the key to its original state. |
| 105 device_policy()->SetDefaultSigningKey(); | 104 device_policy()->SetDefaultSigningKey(); |
| 106 device_policy()->Build(); | 105 device_policy()->Build(); |
| 107 session_manager_client()->set_device_policy(device_policy()->GetBlob()); | 106 session_manager_client()->set_device_policy(device_policy()->GetBlob()); |
| 108 session_manager_client()->OnPropertyChangeComplete(true); | 107 session_manager_client()->OnPropertyChangeComplete(true); |
| 109 } | 108 } |
| 110 | 109 |
| 111 } // namespace policy | 110 } // namespace policy |
| OLD | NEW |