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

Side by Side Diff: blimp/net/blimp_message_thread_pipe_unittest.cc

Issue 2250433006: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/net/blimp_message_thread_pipe.h" 5 #include "blimp/net/blimp_message_thread_pipe.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 BlimpMessageThreadPipeTest() : thread_("PipeThread") {} 26 BlimpMessageThreadPipeTest() : thread_("PipeThread") {}
27 27
28 ~BlimpMessageThreadPipeTest() override {} 28 ~BlimpMessageThreadPipeTest() override {}
29 29
30 void SetUp() override { 30 void SetUp() override {
31 // Start the target processor thread and initialize the pipe & proxy. 31 // Start the target processor thread and initialize the pipe & proxy.
32 // Note that none of this will "touch" the target processor, so it's 32 // Note that none of this will "touch" the target processor, so it's
33 // safe to do here, before EXPECT_CALL() expectations are set up. 33 // safe to do here, before EXPECT_CALL() expectations are set up.
34 ASSERT_TRUE(thread_.Start()); 34 ASSERT_TRUE(thread_.Start());
35 pipe_ = base::WrapUnique(new BlimpMessageThreadPipe(thread_.task_runner())); 35 pipe_ = base::MakeUnique<BlimpMessageThreadPipe>(thread_.task_runner());
36 proxy_ = pipe_->CreateProxy(); 36 proxy_ = pipe_->CreateProxy();
37 37
38 thread_.task_runner()->PostTask( 38 thread_.task_runner()->PostTask(
39 FROM_HERE, base::Bind(&BlimpMessageThreadPipe::set_target_processor, 39 FROM_HERE, base::Bind(&BlimpMessageThreadPipe::set_target_processor,
40 base::Unretained(pipe_.get()), &null_processor_)); 40 base::Unretained(pipe_.get()), &null_processor_));
41 } 41 }
42 42
43 void TearDown() override { 43 void TearDown() override {
44 // If |pipe_| is still active, tear it down safely on |thread_|. 44 // If |pipe_| is still active, tear it down safely on |thread_|.
45 if (pipe_) 45 if (pipe_)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 TEST_F(BlimpMessageThreadPipeTest, NullCompletionCallback) { 113 TEST_F(BlimpMessageThreadPipeTest, NullCompletionCallback) {
114 // Don't expect the mock to be called, but do expect not to crash. 114 // Don't expect the mock to be called, but do expect not to crash.
115 EXPECT_CALL(*this, MockCompletionCallback(_)).Times(0); 115 EXPECT_CALL(*this, MockCompletionCallback(_)).Times(0);
116 116
117 proxy_->ProcessMessage(base::WrapUnique(new BlimpMessage), 117 proxy_->ProcessMessage(base::WrapUnique(new BlimpMessage),
118 net::CompletionCallback()); 118 net::CompletionCallback());
119 } 119 }
120 120
121 } // namespace blimp 121 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/blimp_message_thread_pipe.cc ('k') | blimp/net/blob_channel/blob_channel_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698