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

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

Issue 681723003: Add new shill client for VPN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit tests Created 6 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
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_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
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 PrepareForMethodCall(
148 base::Bind(&ExpectDictionaryValueArgument, arg.get()), 148 shill::kSetPropertiesFunction,
149 response.get()); 149 base::Bind(&ExpectDictionaryValueArgument, arg.get(), false),
stevenjb 2014/10/31 16:35:41 comment false
kaliamoorthi 2014/11/03 10:55:38 Done.
150 response.get());
150 151
151 // Call method. 152 // Call method.
152 MockClosure mock_closure; 153 MockClosure mock_closure;
153 MockErrorCallback mock_error_callback; 154 MockErrorCallback mock_error_callback;
154 client_->SetProperties(dbus::ObjectPath(kExampleServicePath), 155 client_->SetProperties(dbus::ObjectPath(kExampleServicePath),
155 *arg, 156 *arg,
156 mock_closure.GetCallback(), 157 mock_closure.GetCallback(),
157 mock_error_callback.GetCallback()); 158 mock_error_callback.GetCallback());
158 EXPECT_CALL(mock_closure, Run()).Times(1); 159 EXPECT_CALL(mock_closure, Run()).Times(1);
159 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); 160 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 mock_closure.GetCallback(), 296 mock_closure.GetCallback(),
296 mock_error_callback.GetCallback()); 297 mock_error_callback.GetCallback());
297 EXPECT_CALL(mock_closure, Run()).Times(1); 298 EXPECT_CALL(mock_closure, Run()).Times(1);
298 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0); 299 EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
299 300
300 // Run the message loop. 301 // Run the message loop.
301 message_loop_.RunUntilIdle(); 302 message_loop_.RunUntilIdle();
302 } 303 }
303 304
304 } // namespace chromeos 305 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698