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

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

Issue 12207034: Linux/ChromeOS Chromium style checker cleanup, remoting/ edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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 "remoting/protocol/buffered_socket_writer.h" 5 #include "remoting/protocol/buffered_socket_writer.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 26 matching lines...) Expand all
37 writer_.reset(); 37 writer_.reset();
38 socket_.reset(); 38 socket_.reset();
39 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 39 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
40 } 40 }
41 41
42 void Unexpected() { 42 void Unexpected() {
43 EXPECT_TRUE(false); 43 EXPECT_TRUE(false);
44 } 44 }
45 45
46 protected: 46 protected:
47 void SetUp() OVERRIDE { 47 virtual void SetUp() OVERRIDE {
48 socket_.reset(new FakeSocket()); 48 socket_.reset(new FakeSocket());
49 writer_.reset(new BufferedSocketWriter()); 49 writer_.reset(new BufferedSocketWriter());
50 writer_->Init(socket_.get(), base::Bind( 50 writer_->Init(socket_.get(), base::Bind(
51 &BufferedSocketWriterTest::OnWriteFailed, base::Unretained(this))); 51 &BufferedSocketWriterTest::OnWriteFailed, base::Unretained(this)));
52 test_buffer_ = new net::IOBufferWithSize(kTestBufferSize); 52 test_buffer_ = new net::IOBufferWithSize(kTestBufferSize);
53 test_buffer_2_ = new net::IOBufferWithSize(kTestBufferSize); 53 test_buffer_2_ = new net::IOBufferWithSize(kTestBufferSize);
54 for (int i = 0; i< kTestBufferSize; ++i) { 54 for (int i = 0; i< kTestBufferSize; ++i) {
55 test_buffer_->data()[i] = rand() % 256; 55 test_buffer_->data()[i] = rand() % 256;
56 test_buffer_2_->data()[i] = rand() % 256; 56 test_buffer_2_->data()[i] = rand() % 256;
57 } 57 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 socket_->set_next_write_error(net::ERR_FAILED); 177 socket_->set_next_write_error(net::ERR_FAILED);
178 message_loop_.RunUntilIdle(); 178 message_loop_.RunUntilIdle();
179 EXPECT_EQ(net::ERR_FAILED, write_error_); 179 EXPECT_EQ(net::ERR_FAILED, write_error_);
180 EXPECT_EQ(static_cast<size_t>(test_buffer_->size()), 180 EXPECT_EQ(static_cast<size_t>(test_buffer_->size()),
181 socket_->written_data().size()); 181 socket_->written_data().size());
182 } 182 }
183 183
184 } // namespace protocol 184 } // namespace protocol
185 } // namespace remoting 185 } // namespace remoting
186 186
OLDNEW
« no previous file with comments | « remoting/jingle_glue/chromium_socket_factory.cc ('k') | remoting/protocol/channel_multiplexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698