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