OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/cryptohome/homedir_methods.h" | 5 #include "chromeos/cryptohome/homedir_methods.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "chromeos/dbus/cryptohome/rpc.pb.h" | 15 #include "chromeos/dbus/cryptohome/rpc.pb.h" |
15 #include "chromeos/dbus/cryptohome_client.h" | 16 #include "chromeos/dbus/cryptohome_client.h" |
16 #include "chromeos/dbus/dbus_method_call_status.h" | 17 #include "chromeos/dbus/dbus_method_call_status.h" |
17 #include "chromeos/dbus/dbus_thread_manager.h" | 18 #include "chromeos/dbus/dbus_thread_manager.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 85 } |
85 | 86 |
86 HomedirMethodsTest::~HomedirMethodsTest() { | 87 HomedirMethodsTest::~HomedirMethodsTest() { |
87 } | 88 } |
88 | 89 |
89 void HomedirMethodsTest::SetUp() { | 90 void HomedirMethodsTest::SetUp() { |
90 scoped_ptr<chromeos::MockCryptohomeClient> cryptohome_client( | 91 scoped_ptr<chromeos::MockCryptohomeClient> cryptohome_client( |
91 new chromeos::MockCryptohomeClient); | 92 new chromeos::MockCryptohomeClient); |
92 cryptohome_client_ = cryptohome_client.get(); | 93 cryptohome_client_ = cryptohome_client.get(); |
93 chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( | 94 chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( |
94 cryptohome_client.Pass()); | 95 std::move(cryptohome_client)); |
95 HomedirMethods::Initialize(); | 96 HomedirMethods::Initialize(); |
96 } | 97 } |
97 | 98 |
98 void HomedirMethodsTest::TearDown() { | 99 void HomedirMethodsTest::TearDown() { |
99 HomedirMethods::Shutdown(); | 100 HomedirMethods::Shutdown(); |
100 chromeos::DBusThreadManager::Shutdown(); | 101 chromeos::DBusThreadManager::Shutdown(); |
101 } | 102 } |
102 | 103 |
103 void HomedirMethodsTest::RunProtobufMethodCallback( | 104 void HomedirMethodsTest::RunProtobufMethodCallback( |
104 const chromeos::CryptohomeClient::ProtobufMethodCallback& callback) { | 105 const chromeos::CryptohomeClient::ProtobufMethodCallback& callback) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 EXPECT_EQ(kProviderData1Number, *provider_data->number.get()); | 180 EXPECT_EQ(kProviderData1Number, *provider_data->number.get()); |
180 EXPECT_FALSE(provider_data->bytes); | 181 EXPECT_FALSE(provider_data->bytes); |
181 provider_data = &key_definition.provider_data[1]; | 182 provider_data = &key_definition.provider_data[1]; |
182 EXPECT_EQ(kProviderData2Name, provider_data->name); | 183 EXPECT_EQ(kProviderData2Name, provider_data->name); |
183 EXPECT_FALSE(provider_data->number); | 184 EXPECT_FALSE(provider_data->number); |
184 ASSERT_TRUE(provider_data->bytes); | 185 ASSERT_TRUE(provider_data->bytes); |
185 EXPECT_EQ(kProviderData2Bytes, *provider_data->bytes.get()); | 186 EXPECT_EQ(kProviderData2Bytes, *provider_data->bytes.get()); |
186 } | 187 } |
187 | 188 |
188 } // namespace cryptohome | 189 } // namespace cryptohome |
OLD | NEW |