OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/signed_settings_helper.h" | 5 #include "chrome/browser/chromeos/login/signed_settings_helper.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/cros/cros_library.h" | 7 #include "chrome/browser/chromeos/cros/cros_library.h" |
8 #include "chrome/browser/chromeos/cros_settings_names.h" | 8 #include "chrome/browser/chromeos/cros_settings_names.h" |
| 9 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
9 #include "chrome/browser/chromeos/login/mock_ownership_service.h" | 10 #include "chrome/browser/chromeos/login/mock_ownership_service.h" |
10 #include "chrome/browser/chromeos/login/owner_manager.h" | 11 #include "chrome/browser/chromeos/login/owner_manager.h" |
11 #include "chrome/browser/chromeos/login/signed_settings.h" | 12 #include "chrome/browser/chromeos/login/signed_settings.h" |
12 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" | 13 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" |
13 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 14 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
14 #include "content/browser/browser_thread.h" | 15 #include "content/browser/browser_thread.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 | 18 |
18 using ::testing::_; | 19 using ::testing::_; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 fake_value_("false"), | 56 fake_value_("false"), |
56 message_loop_(MessageLoop::TYPE_UI), | 57 message_loop_(MessageLoop::TYPE_UI), |
57 ui_thread_(BrowserThread::UI, &message_loop_), | 58 ui_thread_(BrowserThread::UI, &message_loop_), |
58 file_thread_(BrowserThread::FILE), | 59 file_thread_(BrowserThread::FILE), |
59 pending_ops_(0) { | 60 pending_ops_(0) { |
60 } | 61 } |
61 | 62 |
62 virtual void SetUp() { | 63 virtual void SetUp() { |
63 file_thread_.Start(); | 64 file_thread_.Start(); |
64 SignedSettingsHelper::Get()->set_test_delegate(this); | 65 SignedSettingsHelper::Get()->set_test_delegate(this); |
| 66 DBusThreadManager::Initialize(); |
65 } | 67 } |
66 | 68 |
67 virtual void TearDown() { | 69 virtual void TearDown() { |
| 70 DBusThreadManager::Shutdown(); |
68 SignedSettingsHelper::Get()->set_test_delegate(NULL); | 71 SignedSettingsHelper::Get()->set_test_delegate(NULL); |
69 } | 72 } |
70 | 73 |
71 virtual void OnOpCreated(SignedSettings* op) { | 74 virtual void OnOpCreated(SignedSettings* op) { |
72 // Use MockOwnershipService for all SignedSettings op. | 75 // Use MockOwnershipService for all SignedSettings op. |
73 op->set_service(&m_); | 76 op->set_service(&m_); |
74 } | 77 } |
75 | 78 |
76 virtual void OnOpStarted(SignedSettings* op) { | 79 virtual void OnOpStarted(SignedSettings* op) { |
77 } | 80 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 SignedSettingsHelper::Get()->CancelCallback(&cb_to_be_canceled); | 215 SignedSettingsHelper::Get()->CancelCallback(&cb_to_be_canceled); |
213 | 216 |
214 SignedSettingsHelper::Get()->StartStorePropertyOp(fake_prop_, fake_value_, | 217 SignedSettingsHelper::Get()->StartStorePropertyOp(fake_prop_, fake_value_, |
215 &cb); | 218 &cb); |
216 SignedSettingsHelper::Get()->StartRetrieveProperty(fake_prop_, &cb); | 219 SignedSettingsHelper::Get()->StartRetrieveProperty(fake_prop_, &cb); |
217 | 220 |
218 message_loop_.Run(); | 221 message_loop_.Run(); |
219 } | 222 } |
220 | 223 |
221 } // namespace chromeos | 224 } // namespace chromeos |
OLD | NEW |