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

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

Issue 10382003: Changes needed to roll libjingle r141 (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « content/renderer/p2p/port_allocator.cc ('k') | jingle/glue/utils.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 7 #include "base/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 12 matching lines...) Expand all
23 namespace { 23 namespace {
24 const int kBufferSize = 4096; 24 const int kBufferSize = 4096;
25 const char kTestData[] = "data"; 25 const char kTestData[] = "data";
26 const int kTestDataSize = 4; 26 const int kTestDataSize = 4;
27 const int kTestError = -32123; 27 const int kTestError = -32123;
28 } // namespace 28 } // namespace
29 29
30 class MockTransportChannel : public cricket::TransportChannel { 30 class MockTransportChannel : public cricket::TransportChannel {
31 public: 31 public:
32 MockTransportChannel() 32 MockTransportChannel()
33 : cricket::TransportChannel("", 0) { 33 : cricket::TransportChannel(0) {
34 set_writable(true); 34 set_writable(true);
35 set_readable(true); 35 set_readable(true);
36 } 36 }
37 37
38 MOCK_METHOD3(SendPacket, int(const char* data, size_t len, int flags)); 38 MOCK_METHOD3(SendPacket, int(const char* data, size_t len, int flags));
39 MOCK_METHOD2(SetOption, int(talk_base::Socket::Option opt, int value)); 39 MOCK_METHOD2(SetOption, int(talk_base::Socket::Option opt, int value));
40 MOCK_METHOD0(GetError, int()); 40 MOCK_METHOD0(GetError, int());
41 }; 41 };
42 42
43 class TransportChannelSocketAdapterTest : public testing::Test { 43 class TransportChannelSocketAdapterTest : public testing::Test {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 .WillOnce(Return(SOCKET_ERROR)); 111 .WillOnce(Return(SOCKET_ERROR));
112 112
113 EXPECT_CALL(channel_, GetError()) 113 EXPECT_CALL(channel_, GetError())
114 .WillOnce(Return(EWOULDBLOCK)); 114 .WillOnce(Return(EWOULDBLOCK));
115 115
116 int result = target_->Write(buffer, kTestDataSize, callback_); 116 int result = target_->Write(buffer, kTestDataSize, callback_);
117 ASSERT_EQ(net::OK, result); 117 ASSERT_EQ(net::OK, result);
118 } 118 }
119 119
120 } // namespace jingle_glue 120 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « content/renderer/p2p/port_allocator.cc ('k') | jingle/glue/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698