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

Unified Diff: dbus/mock_unittest.cc

Issue 1867253002: Convert //dbus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: dbus/mock_unittest.cc
diff --git a/dbus/mock_unittest.cc b/dbus/mock_unittest.cc
index 6b2a521127aa1eca0e6dd4c17ef05131a65adb21..ed78e2cb4eb78891acd7aed45f4849e9ac1e39d5 100644
--- a/dbus/mock_unittest.cc
+++ b/dbus/mock_unittest.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "dbus/message.h"
@@ -82,7 +83,7 @@ class MockTest : public testing::Test {
protected:
std::string response_string_;
base::MessageLoop message_loop_;
- scoped_ptr<base::RunLoop> run_loop_;
+ std::unique_ptr<base::RunLoop> run_loop_;
scoped_refptr<MockBus> mock_bus_;
scoped_refptr<MockObjectProxy> mock_proxy_;
@@ -96,7 +97,7 @@ class MockTest : public testing::Test {
MessageReader reader(method_call);
std::string text_message;
if (reader.PopString(&text_message)) {
- scoped_ptr<Response> response = Response::CreateEmpty();
+ std::unique_ptr<Response> response = Response::CreateEmpty();
MessageWriter writer(response.get());
writer.AppendString(text_message);
return response.release();
@@ -151,9 +152,8 @@ TEST_F(MockTest, CallMethodAndBlock) {
writer.AppendString(kHello);
// Call the method.
- scoped_ptr<Response> response(
- proxy->CallMethodAndBlock(&method_call,
- ObjectProxy::TIMEOUT_USE_DEFAULT));
+ std::unique_ptr<Response> response(proxy->CallMethodAndBlock(
+ &method_call, ObjectProxy::TIMEOUT_USE_DEFAULT));
// Check the response.
ASSERT_TRUE(response.get());
@@ -175,9 +175,8 @@ TEST_F(MockTest, CallMethodAndBlockWithErrorDetails) {
ScopedDBusError error;
// Call the method.
- scoped_ptr<Response> response(
- proxy->CallMethodAndBlockWithErrorDetails(
- &method_call, ObjectProxy::TIMEOUT_USE_DEFAULT, &error));
+ std::unique_ptr<Response> response(proxy->CallMethodAndBlockWithErrorDetails(
+ &method_call, ObjectProxy::TIMEOUT_USE_DEFAULT, &error));
// Check the response.
ASSERT_FALSE(response.get());
« dbus/mock_object_proxy.h ('K') | « dbus/mock_object_proxy.h ('k') | dbus/object_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698