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

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: Fixes review comments from Steven 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 // Use a variant valued dictionary rather than a string valued one.
148 base::Bind(&ExpectDictionaryValueArgument, arg.get()), 148 bool string_valued = false;
stevenjb 2014/11/03 16:55:23 const
kaliamoorthi 2014/11/04 12:58:59 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698