Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: chromeos/dbus/shill_device_client_unittest.cc

Issue 11361211: chromeos: Remove unused CrosAddIPConfig/CrosRemoveIPConfig functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/shill_device_client.cc ('k') | chromeos/dbus/shill_ipconfig_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_device_client.h" 8 #include "chromeos/dbus/shill_device_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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 base::Bind(&ExpectStringArgument, flimflam::kTypeDHCP), 239 base::Bind(&ExpectStringArgument, flimflam::kTypeDHCP),
240 response.get()); 240 response.get());
241 // Call method. 241 // Call method.
242 client_->AddIPConfig(dbus::ObjectPath(kExampleDevicePath), 242 client_->AddIPConfig(dbus::ObjectPath(kExampleDevicePath),
243 flimflam::kTypeDHCP, 243 flimflam::kTypeDHCP,
244 base::Bind(&ExpectObjectPathResult, expected_result)); 244 base::Bind(&ExpectObjectPathResult, expected_result));
245 // Run the message loop. 245 // Run the message loop.
246 message_loop_.RunUntilIdle(); 246 message_loop_.RunUntilIdle();
247 } 247 }
248 248
249 TEST_F(ShillDeviceClientTest, CallAddIPConfigAndBlock) {
250 const dbus::ObjectPath expected_result("/result/path");
251 // Create response.
252 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
253 dbus::MessageWriter writer(response.get());
254 writer.AppendObjectPath(expected_result);
255
256 // Set expectations.
257 PrepareForMethodCall(flimflam::kAddIPConfigFunction,
258 base::Bind(&ExpectStringArgument, flimflam::kTypeDHCP),
259 response.get());
260 // Call method.
261 const dbus::ObjectPath result = client_->CallAddIPConfigAndBlock(
262 dbus::ObjectPath(kExampleDevicePath), flimflam::kTypeDHCP);
263 EXPECT_EQ(expected_result, result);
264 }
265
266 TEST_F(ShillDeviceClientTest, RequirePin) { 249 TEST_F(ShillDeviceClientTest, RequirePin) {
267 const char kPin[] = "123456"; 250 const char kPin[] = "123456";
268 const bool kRequired = true; 251 const bool kRequired = true;
269 // Create response. 252 // Create response.
270 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); 253 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
271 254
272 // Set expectations. 255 // Set expectations.
273 MockClosure mock_closure; 256 MockClosure mock_closure;
274 MockErrorCallback mock_error_callback; 257 MockErrorCallback mock_error_callback;
275 PrepareForMethodCall(flimflam::kRequirePinFunction, 258 PrepareForMethodCall(flimflam::kRequirePinFunction,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 // Call method. 386 // Call method.
404 client_->SetCarrier(dbus::ObjectPath(kExampleDevicePath), 387 client_->SetCarrier(dbus::ObjectPath(kExampleDevicePath),
405 kCarrier, 388 kCarrier,
406 mock_closure.GetCallback(), 389 mock_closure.GetCallback(),
407 mock_error_callback.GetCallback()); 390 mock_error_callback.GetCallback());
408 // Run the message loop. 391 // Run the message loop.
409 message_loop_.RunUntilIdle(); 392 message_loop_.RunUntilIdle();
410 } 393 }
411 394
412 } // namespace chromeos 395 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_device_client.cc ('k') | chromeos/dbus/shill_ipconfig_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698