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

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

Issue 10177001: Reimplement CrosSetOfflineMode without Libcros (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 8 months 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
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/flimflam_client_unittest_base.h" 7 #include "chromeos/dbus/flimflam_client_unittest_base.h"
8 #include "chromeos/dbus/flimflam_manager_client.h" 8 #include "chromeos/dbus/flimflam_manager_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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 &value), 180 &value),
181 response.get()); 181 response.get());
182 // Call method. 182 // Call method.
183 client_->SetProperty(flimflam::kCheckPortalListProperty, 183 client_->SetProperty(flimflam::kCheckPortalListProperty,
184 value, 184 value,
185 base::Bind(&ExpectNoResultValue)); 185 base::Bind(&ExpectNoResultValue));
186 // Run the message loop. 186 // Run the message loop.
187 message_loop_.RunAllPending(); 187 message_loop_.RunAllPending();
188 } 188 }
189 189
190 TEST_F(FlimflamManagerClientTest, CallSetPropertyAndBlock) {
191 // Create response.
192 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
193 // Set expectations.
194 base::StringValue value("portal list");
195 PrepareForMethodCall(flimflam::kSetPropertyFunction,
196 base::Bind(ExpectStringAndValueArguments,
197 flimflam::kCheckPortalListProperty,
198 &value),
199 response.get());
200 // Call method.
201 const bool result = client_->CallSetPropertyAndBlock(
202 flimflam::kCheckPortalListProperty, value);
203 EXPECT_TRUE(result);
stevenjb 2012/04/23 21:42:06 Shouldn't need this.
hashimoto 2012/04/24 04:37:54 Done.
204 }
205
190 TEST_F(FlimflamManagerClientTest, RequestScan) { 206 TEST_F(FlimflamManagerClientTest, RequestScan) {
191 // Create response. 207 // Create response.
192 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); 208 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
193 // Set expectations. 209 // Set expectations.
194 PrepareForMethodCall(flimflam::kRequestScanFunction, 210 PrepareForMethodCall(flimflam::kRequestScanFunction,
195 base::Bind(&ExpectStringArgument, flimflam::kTypeWifi), 211 base::Bind(&ExpectStringArgument, flimflam::kTypeWifi),
196 response.get()); 212 response.get());
197 // Call method. 213 // Call method.
198 client_->RequestScan(flimflam::kTypeWifi, base::Bind(&ExpectNoResultValue)); 214 client_->RequestScan(flimflam::kTypeWifi, base::Bind(&ExpectNoResultValue));
199 // Run the message loop. 215 // Run the message loop.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 PrepareForMethodCall(flimflam::kGetServiceFunction, 271 PrepareForMethodCall(flimflam::kGetServiceFunction,
256 base::Bind(&ExpectDictionaryValueArgument, arg.get()), 272 base::Bind(&ExpectDictionaryValueArgument, arg.get()),
257 response.get()); 273 response.get());
258 // Call method. 274 // Call method.
259 client_->GetService(*arg, base::Bind(&ExpectObjectPathResult, object_path)); 275 client_->GetService(*arg, base::Bind(&ExpectObjectPathResult, object_path));
260 // Run the message loop. 276 // Run the message loop.
261 message_loop_.RunAllPending(); 277 message_loop_.RunAllPending();
262 } 278 }
263 279
264 } // namespace chromeos 280 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698