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

Side by Side Diff: google_apis/gcm/base/mcs_message_unittest.cc

Issue 1547233002: Convert Pass()→std::move() in //google_apis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « google_apis/gcm/base/mcs_message.cc ('k') | google_apis/gcm/base/mcs_util.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "google_apis/gcm/base/mcs_message.h" 5 #include "google_apis/gcm/base/mcs_message.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility>
8 9
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "base/test/test_simple_task_runner.h" 11 #include "base/test/test_simple_task_runner.h"
11 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
12 #include "google_apis/gcm/base/mcs_util.h" 13 #include "google_apis/gcm/base/mcs_util.h"
13 #include "google_apis/gcm/protocol/mcs.pb.h" 14 #include "google_apis/gcm/protocol/mcs.pb.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace gcm { 17 namespace gcm {
17 18
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 login_copy = message.CloneProtobuf(); 76 login_copy = message.CloneProtobuf();
76 EXPECT_EQ(login_request->SerializeAsString(), 77 EXPECT_EQ(login_request->SerializeAsString(),
77 login_copy->SerializeAsString()); 78 login_copy->SerializeAsString());
78 } 79 }
79 80
80 TEST_F(MCSMessageTest, InitPassOwnership) { 81 TEST_F(MCSMessageTest, InitPassOwnership) {
81 scoped_ptr<mcs_proto::LoginRequest> login_request( 82 scoped_ptr<mcs_proto::LoginRequest> login_request(
82 BuildLoginRequest(kAndroidId, kSecret, "")); 83 BuildLoginRequest(kAndroidId, kSecret, ""));
83 scoped_ptr<google::protobuf::MessageLite> login_copy( 84 scoped_ptr<google::protobuf::MessageLite> login_copy(
84 new mcs_proto::LoginRequest(*login_request)); 85 new mcs_proto::LoginRequest(*login_request));
85 MCSMessage message(kLoginRequestTag, login_copy.Pass()); 86 MCSMessage message(kLoginRequestTag, std::move(login_copy));
86 EXPECT_FALSE(login_copy.get()); 87 EXPECT_FALSE(login_copy.get());
87 ASSERT_TRUE(message.IsValid()); 88 ASSERT_TRUE(message.IsValid());
88 EXPECT_EQ(kLoginRequestTag, message.tag()); 89 EXPECT_EQ(kLoginRequestTag, message.tag());
89 EXPECT_EQ(login_request->ByteSize(), message.size()); 90 EXPECT_EQ(login_request->ByteSize(), message.size());
90 EXPECT_EQ(login_request->SerializeAsString(), message.SerializeAsString()); 91 EXPECT_EQ(login_request->SerializeAsString(), message.SerializeAsString());
91 EXPECT_EQ(login_request->SerializeAsString(), 92 EXPECT_EQ(login_request->SerializeAsString(),
92 message.GetProtobuf().SerializeAsString()); 93 message.GetProtobuf().SerializeAsString());
93 login_copy = message.CloneProtobuf(); 94 login_copy = message.CloneProtobuf();
94 EXPECT_EQ(login_request->SerializeAsString(), 95 EXPECT_EQ(login_request->SerializeAsString(),
95 login_copy->SerializeAsString()); 96 login_copy->SerializeAsString());
96 } 97 }
97 98
98 } // namespace gcm 99 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gcm/base/mcs_message.cc ('k') | google_apis/gcm/base/mcs_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698