| 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_service_client.h" | 8 #include "chromeos/dbus/shill_service_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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 137   // Run the message loop. | 137   // Run the message loop. | 
| 138   message_loop_.RunUntilIdle(); | 138   message_loop_.RunUntilIdle(); | 
| 139 } | 139 } | 
| 140 | 140 | 
| 141 TEST_F(ShillServiceClientTest, SetProperties) { | 141 TEST_F(ShillServiceClientTest, SetProperties) { | 
| 142   // Create response. | 142   // Create response. | 
| 143   scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 143   scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); | 
| 144 | 144 | 
| 145   // Set expectations. | 145   // Set expectations. | 
| 146   scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); | 146   scoped_ptr<base::DictionaryValue> arg(CreateExampleServiceProperties()); | 
| 147   PrepareForMethodCall(shill::kSetPropertiesFunction, | 147   // Use a variant valued dictionary rather than a string valued one. | 
| 148                        base::Bind(&ExpectDictionaryValueArgument, arg.get()), | 148   const bool string_valued = false; | 
| 149                        response.get()); | 149   PrepareForMethodCall( | 
|  | 150       shill::kSetPropertiesFunction, | 
|  | 151       base::Bind(&ExpectDictionaryValueArgument, arg.get(), string_valued), | 
|  | 152       response.get()); | 
| 150 | 153 | 
| 151   // Call method. | 154   // Call method. | 
| 152   MockClosure mock_closure; | 155   MockClosure mock_closure; | 
| 153   MockErrorCallback mock_error_callback; | 156   MockErrorCallback mock_error_callback; | 
| 154   client_->SetProperties(dbus::ObjectPath(kExampleServicePath), | 157   client_->SetProperties(dbus::ObjectPath(kExampleServicePath), | 
| 155                          *arg, | 158                          *arg, | 
| 156                          mock_closure.GetCallback(), | 159                          mock_closure.GetCallback(), | 
| 157                          mock_error_callback.GetCallback()); | 160                          mock_error_callback.GetCallback()); | 
| 158   EXPECT_CALL(mock_closure, Run()).Times(1); | 161   EXPECT_CALL(mock_closure, Run()).Times(1); | 
| 159   EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 162   EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 295                                  mock_closure.GetCallback(), | 298                                  mock_closure.GetCallback(), | 
| 296                                  mock_error_callback.GetCallback()); | 299                                  mock_error_callback.GetCallback()); | 
| 297   EXPECT_CALL(mock_closure, Run()).Times(1); | 300   EXPECT_CALL(mock_closure, Run()).Times(1); | 
| 298   EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 301   EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 
| 299 | 302 | 
| 300   // Run the message loop. | 303   // Run the message loop. | 
| 301   message_loop_.RunUntilIdle(); | 304   message_loop_.RunUntilIdle(); | 
| 302 } | 305 } | 
| 303 | 306 | 
| 304 }  // namespace chromeos | 307 }  // namespace chromeos | 
| OLD | NEW | 
|---|