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

Unified Diff: mojo/edk/embedder/platform_channel_pair_posix_unittest.cc

Issue 1529303004: Convert Pass()→std::move() in mojo/edk/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair.cc ('k') | mojo/edk/embedder/simple_platform_shared_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
diff --git a/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc b/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
index 1874e42ce0580f714731287a06bc200ff9bfd232..179efb1d051d904bacd3dab890849f0fdea730cd 100644
--- a/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
+++ b/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
@@ -12,8 +12,8 @@
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
-
#include <deque>
+#include <utility>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -64,8 +64,8 @@ class PlatformChannelPairPosixTest : public testing::Test {
TEST_F(PlatformChannelPairPosixTest, NoSigPipe) {
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
// Write to the client.
static const char kHello[] = "hello";
@@ -105,8 +105,8 @@ TEST_F(PlatformChannelPairPosixTest, NoSigPipe) {
TEST_F(PlatformChannelPairPosixTest, SendReceiveData) {
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
for (size_t i = 0; i < 10; i++) {
std::string send_string(1 << i, 'A' + i);
@@ -134,8 +134,8 @@ TEST_F(PlatformChannelPairPosixTest, SendReceiveFDs) {
static const char kHello[] = "hello";
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
// Reduce the number of FDs opened on OS X to avoid test flake.
#if defined(OS_MACOSX)
@@ -156,7 +156,7 @@ TEST_F(PlatformChannelPairPosixTest, SendReceiveFDs) {
ASSERT_TRUE(fp);
ASSERT_EQ(j, fwrite(std::string(j, c).data(), 1, j, fp.get()));
platform_handles->push_back(
- test::PlatformHandleFromFILE(fp.Pass()).release());
+ test::PlatformHandleFromFILE(std::move(fp)).release());
ASSERT_TRUE(platform_handles->back().is_valid());
}
@@ -200,8 +200,8 @@ TEST_F(PlatformChannelPairPosixTest, AppendReceivedFDs) {
static const char kHello[] = "hello";
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
const std::string file_contents("hello world");
@@ -214,7 +214,7 @@ TEST_F(PlatformChannelPairPosixTest, AppendReceivedFDs) {
fwrite(file_contents.data(), 1, file_contents.size(), fp.get()));
ScopedPlatformHandleVectorPtr platform_handles(new PlatformHandleVector);
platform_handles->push_back(
- test::PlatformHandleFromFILE(fp.Pass()).release());
+ test::PlatformHandleFromFILE(std::move(fp)).release());
ASSERT_TRUE(platform_handles->back().is_valid());
// Send the FD (+ "hello").
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair.cc ('k') | mojo/edk/embedder/simple_platform_shared_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698