Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "chrome/browser/chromeos/settings/signed_settings_helper.h" | 5 #include "chrome/browser/chromeos/settings/signed_settings_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 10 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 10 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 SignedSettingsHelperTest() | 39 SignedSettingsHelperTest() |
| 40 : message_loop_(MessageLoop::TYPE_UI), | 40 : message_loop_(MessageLoop::TYPE_UI), |
| 41 ui_thread_(content::BrowserThread::UI, &message_loop_), | 41 ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 42 file_thread_(content::BrowserThread::FILE, &message_loop_), | 42 file_thread_(content::BrowserThread::FILE, &message_loop_), |
| 43 pending_ops_(0), | 43 pending_ops_(0), |
| 44 mock_dbus_thread_manager_(new MockDBusThreadManager) { | 44 mock_dbus_thread_manager_(new MockDBusThreadManager) { |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void SetUp() { | 47 virtual void SetUp() { |
| 48 SignedSettingsHelper::Get()->set_test_delegate(this); | 48 SignedSettingsHelper::Get()->set_test_delegate(this); |
| 49 EXPECT_CALL(*mock_dbus_thread_manager, GetSystemBus()) | |
|
satorux1
2012/08/11 23:00:07
mock_dbus_thread_manager -> mock_dbus_thread_manag
| |
| 50 .WillRepeatedly(Return(reinterpret_cast<dbus::Bus*>(NULL))); | |
| 49 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager_); | 51 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager_); |
| 50 | 52 |
| 51 fake_policy_data_ = BuildPolicyData(); | 53 fake_policy_data_ = BuildPolicyData(); |
| 52 std::string data_serialized = fake_policy_data_.SerializeAsString(); | 54 std::string data_serialized = fake_policy_data_.SerializeAsString(); |
| 53 std::string serialized_policy_; | 55 std::string serialized_policy_; |
| 54 fake_policy_ = BuildProto(data_serialized, | 56 fake_policy_ = BuildProto(data_serialized, |
| 55 std::string("false"), | 57 std::string("false"), |
| 56 &serialized_policy_); | 58 &serialized_policy_); |
| 57 | 59 |
| 58 MockSessionManagerClient* client = | 60 MockSessionManagerClient* client = |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 base::Unretained(&cb))); | 202 base::Unretained(&cb))); |
| 201 SignedSettingsHelper::Get()->StartRetrievePolicyOp( | 203 SignedSettingsHelper::Get()->StartRetrievePolicyOp( |
| 202 base::Bind(&MockSignedSettingsCallbacks::OnRetrievePolicyCompleted, | 204 base::Bind(&MockSignedSettingsCallbacks::OnRetrievePolicyCompleted, |
| 203 base::Unretained(&cb))); | 205 base::Unretained(&cb))); |
| 204 | 206 |
| 205 message_loop_.RunAllPending(); | 207 message_loop_.RunAllPending(); |
| 206 ASSERT_EQ(0, pending_ops_); | 208 ASSERT_EQ(0, pending_ops_); |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace chromeos | 211 } // namespace chromeos |
| OLD | NEW |