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/test/mock_callback.h" | 7 #include "base/test/mock_callback.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chromeos/dbus/shill_client_unittest_base.h" | 9 #include "chromeos/dbus/shill_client_unittest_base.h" |
10 #include "chromeos/dbus/shill_profile_client.h" | 10 #include "chromeos/dbus/shill_profile_client.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 dbus::MessageWriter entry_writer(NULL); | 136 dbus::MessageWriter entry_writer(NULL); |
137 array_writer.OpenDictEntry(&entry_writer); | 137 array_writer.OpenDictEntry(&entry_writer); |
138 entry_writer.AppendString(shill::kTypeProperty); | 138 entry_writer.AppendString(shill::kTypeProperty); |
139 entry_writer.AppendVariantOfString(shill::kTypeWifi); | 139 entry_writer.AppendVariantOfString(shill::kTypeWifi); |
140 array_writer.CloseContainer(&entry_writer); | 140 array_writer.CloseContainer(&entry_writer); |
141 writer.CloseContainer(&array_writer); | 141 writer.CloseContainer(&array_writer); |
142 | 142 |
143 // Create the expected value. | 143 // Create the expected value. |
144 base::DictionaryValue value; | 144 base::DictionaryValue value; |
145 value.SetWithoutPathExpansion(shill::kTypeProperty, | 145 value.SetWithoutPathExpansion(shill::kTypeProperty, |
146 new base::StringValue(shill::kTypeWifi)); | 146 new base::Value(shill::kTypeWifi)); |
147 // Set expectations. | 147 // Set expectations. |
148 PrepareForMethodCall(shill::kGetEntryFunction, | 148 PrepareForMethodCall(shill::kGetEntryFunction, |
149 base::Bind(&ExpectStringArgument, kExampleEntryPath), | 149 base::Bind(&ExpectStringArgument, kExampleEntryPath), |
150 response.get()); | 150 response.get()); |
151 // Call method. | 151 // Call method. |
152 base::MockCallback<ShillProfileClient::ErrorCallback> error_callback; | 152 base::MockCallback<ShillProfileClient::ErrorCallback> error_callback; |
153 client_->GetEntry( | 153 client_->GetEntry( |
154 dbus::ObjectPath(kDefaultProfilePath), kExampleEntryPath, | 154 dbus::ObjectPath(kDefaultProfilePath), kExampleEntryPath, |
155 base::Bind(&ExpectDictionaryValueResultWithoutStatus, &value), | 155 base::Bind(&ExpectDictionaryValueResultWithoutStatus, &value), |
156 error_callback.Get()); | 156 error_callback.Get()); |
(...skipping 20 matching lines...) Expand all Loading... |
177 client_->DeleteEntry(dbus::ObjectPath(kDefaultProfilePath), kExampleEntryPath, | 177 client_->DeleteEntry(dbus::ObjectPath(kDefaultProfilePath), kExampleEntryPath, |
178 mock_closure.Get(), mock_error_callback.Get()); | 178 mock_closure.Get(), mock_error_callback.Get()); |
179 EXPECT_CALL(mock_closure, Run()).Times(1); | 179 EXPECT_CALL(mock_closure, Run()).Times(1); |
180 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); | 180 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); |
181 | 181 |
182 // Run the message loop. | 182 // Run the message loop. |
183 base::RunLoop().RunUntilIdle(); | 183 base::RunLoop().RunUntilIdle(); |
184 } | 184 } |
185 | 185 |
186 } // namespace chromeos | 186 } // namespace chromeos |
OLD | NEW |