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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chromeos/dbus/shill_client_unittest_base.h" | 8 #include "chromeos/dbus/shill_client_unittest_base.h" |
9 #include "chromeos/dbus/shill_profile_client.h" | 9 #include "chromeos/dbus/shill_profile_client.h" |
10 #include "dbus/message.h" | 10 #include "dbus/message.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 base::RunLoop().RunUntilIdle(); | 159 base::RunLoop().RunUntilIdle(); |
160 } | 160 } |
161 | 161 |
162 TEST_F(ShillProfileClientTest, DeleteEntry) { | 162 TEST_F(ShillProfileClientTest, DeleteEntry) { |
163 // Create response. | 163 // Create response. |
164 std::unique_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 164 std::unique_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
165 | 165 |
166 // Create the expected value. | 166 // Create the expected value. |
167 base::DictionaryValue value; | 167 base::DictionaryValue value; |
168 value.SetWithoutPathExpansion(shill::kOfflineModeProperty, | 168 value.SetWithoutPathExpansion(shill::kOfflineModeProperty, |
169 new base::FundamentalValue(true)); | 169 new base::Value(true)); |
170 // Set expectations. | 170 // Set expectations. |
171 PrepareForMethodCall(shill::kDeleteEntryFunction, | 171 PrepareForMethodCall(shill::kDeleteEntryFunction, |
172 base::Bind(&ExpectStringArgument, kExampleEntryPath), | 172 base::Bind(&ExpectStringArgument, kExampleEntryPath), |
173 response.get()); | 173 response.get()); |
174 // Call method. | 174 // Call method. |
175 MockClosure mock_closure; | 175 MockClosure mock_closure; |
176 MockErrorCallback mock_error_callback; | 176 MockErrorCallback mock_error_callback; |
177 client_->DeleteEntry(dbus::ObjectPath(kDefaultProfilePath), | 177 client_->DeleteEntry(dbus::ObjectPath(kDefaultProfilePath), |
178 kExampleEntryPath, | 178 kExampleEntryPath, |
179 mock_closure.GetCallback(), | 179 mock_closure.GetCallback(), |
180 mock_error_callback.GetCallback()); | 180 mock_error_callback.GetCallback()); |
181 EXPECT_CALL(mock_closure, Run()).Times(1); | 181 EXPECT_CALL(mock_closure, Run()).Times(1); |
182 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 182 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
183 | 183 |
184 // Run the message loop. | 184 // Run the message loop. |
185 base::RunLoop().RunUntilIdle(); | 185 base::RunLoop().RunUntilIdle(); |
186 } | 186 } |
187 | 187 |
188 } // namespace chromeos | 188 } // namespace chromeos |
OLD | NEW |