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

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

Issue 660803004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 (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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 task.Run(); 60 task.Run();
61 } 61 }
62 62
63 // Used by the DeleteFromCallback() test. 63 // Used by the DeleteFromCallback() test.
64 void DeleteReader(const base::Closure& task) { 64 void DeleteReader(const base::Closure& task) {
65 reader_.reset(); 65 reader_.reset();
66 task.Run(); 66 task.Run();
67 } 67 }
68 68
69 protected: 69 protected:
70 virtual void SetUp() override { 70 void SetUp() override { reader_.reset(new MessageReader()); }
71 reader_.reset(new MessageReader());
72 }
73 71
74 virtual void TearDown() override { 72 void TearDown() override { STLDeleteElements(&messages_); }
75 STLDeleteElements(&messages_);
76 }
77 73
78 void InitReader() { 74 void InitReader() {
79 reader_->Init(&socket_, base::Bind( 75 reader_->Init(&socket_, base::Bind(
80 &MessageReaderTest::OnMessage, base::Unretained(this))); 76 &MessageReaderTest::OnMessage, base::Unretained(this)));
81 } 77 }
82 78
83 void AddMessage(const std::string& message) { 79 void AddMessage(const std::string& message) {
84 std::string data = std::string(4, ' ') + message; 80 std::string data = std::string(4, ' ') + message;
85 rtc::SetBE32(const_cast<char*>(data.data()), message.size()); 81 rtc::SetBE32(const_cast<char*>(data.data()), message.size());
86 82
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 EXPECT_CALL(callback_, OnMessage(_)) 314 EXPECT_CALL(callback_, OnMessage(_))
319 .Times(1) 315 .Times(1)
320 .WillOnce(Invoke(this, &MessageReaderTest::DeleteReader)); 316 .WillOnce(Invoke(this, &MessageReaderTest::DeleteReader));
321 317
322 InitReader(); 318 InitReader();
323 base::RunLoop().RunUntilIdle(); 319 base::RunLoop().RunUntilIdle();
324 } 320 }
325 321
326 } // namespace protocol 322 } // namespace protocol
327 } // namespace remoting 323 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/negotiating_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698