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

Side by Side Diff: remoting/protocol/message_reader_unittest.cc

Issue 2230193002: remoting: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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
« no previous file with comments | « remoting/protocol/message_decoder_unittest.cc ('k') | no next file » | 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void AddSecondMessage() { AddMessage(kTestMessage2); } 43 void AddSecondMessage() { AddMessage(kTestMessage2); }
44 44
45 // Used by the DeleteFromCallback() test. 45 // Used by the DeleteFromCallback() test.
46 void DeleteReader() { reader_.reset(); } 46 void DeleteReader() { reader_.reset(); }
47 47
48 protected: 48 protected:
49 void SetUp() override { 49 void SetUp() override {
50 reader_.reset(new MessageReader()); 50 reader_.reset(new MessageReader());
51 } 51 }
52 52
53 void TearDown() override { STLDeleteElements(&messages_); } 53 void TearDown() override { base::STLDeleteElements(&messages_); }
54 54
55 void InitReader() { 55 void InitReader() {
56 reader_->StartReading( 56 reader_->StartReading(
57 &socket_, 57 &socket_,
58 base::Bind(&MessageReaderTest::OnMessage, base::Unretained(this)), 58 base::Bind(&MessageReaderTest::OnMessage, base::Unretained(this)),
59 base::Bind(&MessageReaderTest::OnReadError, base::Unretained(this))); 59 base::Bind(&MessageReaderTest::OnReadError, base::Unretained(this)));
60 } 60 }
61 61
62 void AddMessage(const std::string& message) { 62 void AddMessage(const std::string& message) {
63 std::string data = std::string(4, ' ') + message; 63 std::string data = std::string(4, ' ') + message;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 EXPECT_CALL(callback_, OnMessage()) 185 EXPECT_CALL(callback_, OnMessage())
186 .Times(1) 186 .Times(1)
187 .WillOnce(Invoke(this, &MessageReaderTest::DeleteReader)); 187 .WillOnce(Invoke(this, &MessageReaderTest::DeleteReader));
188 188
189 InitReader(); 189 InitReader();
190 base::RunLoop().RunUntilIdle(); 190 base::RunLoop().RunUntilIdle();
191 } 191 }
192 192
193 } // namespace protocol 193 } // namespace protocol
194 } // namespace remoting 194 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/message_decoder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698