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

Side by Side Diff: jingle/glue/channel_socket_adapter_unittest.cc

Issue 103143004: Update webrtc/libjingle 5268:5288. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « jingle/glue/channel_socket_adapter.cc ('k') | jingle/glue/fake_socket_factory.cc » ('j') | 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "jingle/glue/channel_socket_adapter.h" 8 #include "jingle/glue/channel_socket_adapter.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 base::MessageLoopForIO message_loop_; 81 base::MessageLoopForIO message_loop_;
82 }; 82 };
83 83
84 // Verify that Read() returns net::ERR_IO_PENDING. 84 // Verify that Read() returns net::ERR_IO_PENDING.
85 TEST_F(TransportChannelSocketAdapterTest, Read) { 85 TEST_F(TransportChannelSocketAdapterTest, Read) {
86 scoped_refptr<IOBuffer> buffer(new IOBuffer(kBufferSize)); 86 scoped_refptr<IOBuffer> buffer(new IOBuffer(kBufferSize));
87 87
88 int result = target_->Read(buffer.get(), kBufferSize, callback_); 88 int result = target_->Read(buffer.get(), kBufferSize, callback_);
89 ASSERT_EQ(net::ERR_IO_PENDING, result); 89 ASSERT_EQ(net::ERR_IO_PENDING, result);
90 90
91 channel_.SignalReadPacket(&channel_, kTestData, kTestDataSize, 0); 91 channel_.SignalReadPacket(&channel_, kTestData, kTestDataSize,
92 talk_base::CreatePacketTime(0), 0);
92 EXPECT_EQ(kTestDataSize, callback_result_); 93 EXPECT_EQ(kTestDataSize, callback_result_);
93 } 94 }
94 95
95 // Verify that Read() after Close() returns error. 96 // Verify that Read() after Close() returns error.
96 TEST_F(TransportChannelSocketAdapterTest, ReadClose) { 97 TEST_F(TransportChannelSocketAdapterTest, ReadClose) {
97 scoped_refptr<IOBuffer> buffer(new IOBuffer(kBufferSize)); 98 scoped_refptr<IOBuffer> buffer(new IOBuffer(kBufferSize));
98 99
99 int result = target_->Read(buffer.get(), kBufferSize, callback_); 100 int result = target_->Read(buffer.get(), kBufferSize, callback_);
100 ASSERT_EQ(net::ERR_IO_PENDING, result); 101 ASSERT_EQ(net::ERR_IO_PENDING, result);
101 102
(...skipping 27 matching lines...) Expand all
129 .WillOnce(Return(SOCKET_ERROR)); 130 .WillOnce(Return(SOCKET_ERROR));
130 131
131 EXPECT_CALL(channel_, GetError()) 132 EXPECT_CALL(channel_, GetError())
132 .WillOnce(Return(EWOULDBLOCK)); 133 .WillOnce(Return(EWOULDBLOCK));
133 134
134 int result = target_->Write(buffer.get(), kTestDataSize, callback_); 135 int result = target_->Write(buffer.get(), kTestDataSize, callback_);
135 ASSERT_EQ(net::OK, result); 136 ASSERT_EQ(net::OK, result);
136 } 137 }
137 138
138 } // namespace jingle_glue 139 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « jingle/glue/channel_socket_adapter.cc ('k') | jingle/glue/fake_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698