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

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

Issue 2023633002: Change PopDataAsValue to return a std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
« no previous file with comments | « no previous file | dbus/values_util.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 "chromeos/dbus/shill_client_unittest_base.h" 5 #include "chromeos/dbus/shill_client_unittest_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 std::unique_ptr<base::Value> value; 318 std::unique_ptr<base::Value> value;
319 // Variants in the dictionary can be basic types or string-to-string 319 // Variants in the dictionary can be basic types or string-to-string
320 // dictinoary. 320 // dictinoary.
321 switch (variant_reader.GetDataType()) { 321 switch (variant_reader.GetDataType()) {
322 case dbus::Message::ARRAY: 322 case dbus::Message::ARRAY:
323 value.reset(PopStringToStringDictionary(&variant_reader)); 323 value.reset(PopStringToStringDictionary(&variant_reader));
324 break; 324 break;
325 case dbus::Message::BOOL: 325 case dbus::Message::BOOL:
326 case dbus::Message::INT32: 326 case dbus::Message::INT32:
327 case dbus::Message::STRING: 327 case dbus::Message::STRING:
328 value.reset(dbus::PopDataAsValue(&variant_reader)); 328 value = dbus::PopDataAsValue(&variant_reader);
329 break; 329 break;
330 default: 330 default:
331 NOTREACHED(); 331 NOTREACHED();
332 } 332 }
333 ASSERT_TRUE(value.get()); 333 ASSERT_TRUE(value.get());
334 const base::Value* expected_value = NULL; 334 const base::Value* expected_value = NULL;
335 EXPECT_TRUE(expected_dictionary->GetWithoutPathExpansion(key, 335 EXPECT_TRUE(expected_dictionary->GetWithoutPathExpansion(key,
336 &expected_value)); 336 &expected_value));
337 EXPECT_TRUE(value->Equals(expected_value)); 337 EXPECT_TRUE(value->Equals(expected_value));
338 } 338 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 463
464 void ShillClientUnittestBase::OnCallMethodWithErrorCallback( 464 void ShillClientUnittestBase::OnCallMethodWithErrorCallback(
465 dbus::MethodCall* method_call, 465 dbus::MethodCall* method_call,
466 int timeout_ms, 466 int timeout_ms,
467 const dbus::ObjectProxy::ResponseCallback& response_callback, 467 const dbus::ObjectProxy::ResponseCallback& response_callback,
468 const dbus::ObjectProxy::ErrorCallback& error_callback) { 468 const dbus::ObjectProxy::ErrorCallback& error_callback) {
469 OnCallMethod(method_call, timeout_ms, response_callback); 469 OnCallMethod(method_call, timeout_ms, response_callback);
470 } 470 }
471 471
472 } // namespace chromeos 472 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | dbus/values_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698