Enable socketservers unittests on windows.
failing tests disabling moved to ifdefs within the test files from build files. R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/2199193004 . Cr-Commit-Position: refs/heads/master@{#13623}
This commit is contained in:
parent
837a1707ae
commit
e51e11910f
@ -697,6 +697,9 @@ if (rtc_include_tests) {
|
||||
public_configs = [ ":common_inherited_config" ]
|
||||
sources = [
|
||||
"base/nullsocketserver_unittest.cc",
|
||||
"base/physicalsocketserver_unittest.cc",
|
||||
"base/socket_unittest.cc",
|
||||
"base/socket_unittest.h",
|
||||
"base/socketaddress_unittest.cc",
|
||||
"base/virtualsocket_unittest.cc",
|
||||
]
|
||||
@ -706,17 +709,7 @@ if (rtc_include_tests) {
|
||||
"//testing/gtest",
|
||||
]
|
||||
if (is_win) {
|
||||
# TODO(ronghuawu): Fix TestUdpReadyToSendIPv6 on windows bot then reenable
|
||||
# these tests.
|
||||
# sources += [ "base/win32socketserver_unittest.cc" ]
|
||||
} else {
|
||||
# TODO(pbos): Move test disabling to ifdefs within the test files instead
|
||||
# of here.
|
||||
sources += [
|
||||
"base/physicalsocketserver_unittest.cc",
|
||||
"base/socket_unittest.cc",
|
||||
"base/socket_unittest.h",
|
||||
]
|
||||
sources += [ "base/win32socketserver_unittest.cc" ]
|
||||
}
|
||||
if (is_android) {
|
||||
deps += [ "//testing/android/native_test:native_test_support" ]
|
||||
|
||||
@ -259,11 +259,23 @@ void PhysicalSocketTest::WritableAfterPartialWrite(const IPAddress& loopback) {
|
||||
TcpInternal(loopback, kDataSize, kMaxSendSize);
|
||||
}
|
||||
|
||||
TEST_F(PhysicalSocketTest, TestWritableAfterPartialWriteIPv4) {
|
||||
// https://bugs.chromium.org/p/webrtc/issues/detail?id=6167
|
||||
#if defined(WEBRTC_WIN)
|
||||
#define MAYBE_TestWritableAfterPartialWriteIPv4 DISABLED_TestWritableAfterPartialWriteIPv4
|
||||
#else
|
||||
#define MAYBE_TestWritableAfterPartialWriteIPv4 TestWritableAfterPartialWriteIPv4
|
||||
#endif
|
||||
TEST_F(PhysicalSocketTest, MAYBE_TestWritableAfterPartialWriteIPv4) {
|
||||
WritableAfterPartialWrite(kIPv4Loopback);
|
||||
}
|
||||
|
||||
TEST_F(PhysicalSocketTest, TestWritableAfterPartialWriteIPv6) {
|
||||
// https://bugs.chromium.org/p/webrtc/issues/detail?id=6167
|
||||
#if defined(WEBRTC_WIN)
|
||||
#define MAYBE_TestWritableAfterPartialWriteIPv6 DISABLED_TestWritableAfterPartialWriteIPv6
|
||||
#else
|
||||
#define MAYBE_TestWritableAfterPartialWriteIPv6 TestWritableAfterPartialWriteIPv6
|
||||
#endif
|
||||
TEST_F(PhysicalSocketTest, MAYBE_TestWritableAfterPartialWriteIPv6) {
|
||||
MAYBE_SKIP_IPV6;
|
||||
WritableAfterPartialWrite(kIPv6Loopback);
|
||||
}
|
||||
@ -372,7 +384,13 @@ TEST_F(PhysicalSocketTest, MAYBE_TestUdpReadyToSendIPv4) {
|
||||
SocketTest::TestUdpReadyToSendIPv4();
|
||||
}
|
||||
|
||||
TEST_F(PhysicalSocketTest, TestUdpReadyToSendIPv6) {
|
||||
// https://bugs.chromium.org/p/webrtc/issues/detail?id=6167
|
||||
#if defined(WEBRTC_WIN)
|
||||
#define MAYBE_TestUdpReadyToSendIPv6 DISABLED_TestUdpReadyToSendIPv6
|
||||
#else
|
||||
#define MAYBE_TestUdpReadyToSendIPv6 TestUdpReadyToSendIPv6
|
||||
#endif
|
||||
TEST_F(PhysicalSocketTest, MAYBE_TestUdpReadyToSendIPv6) {
|
||||
SocketTest::TestUdpReadyToSendIPv6();
|
||||
}
|
||||
|
||||
|
||||
@ -681,7 +681,7 @@ void SocketTest::SocketServerWaitInternal(const IPAddress& loopback) {
|
||||
}
|
||||
|
||||
void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
ssize_t max_send_size) {
|
||||
ptrdiff_t max_send_size) {
|
||||
testing::StreamSink sink;
|
||||
SocketAddress accept_addr;
|
||||
|
||||
@ -719,6 +719,7 @@ void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
char ch = static_cast<char>(i % 256);
|
||||
send_buffer.AppendData(&ch, sizeof(ch));
|
||||
}
|
||||
rtc::Buffer recved_data(0, data_size);
|
||||
|
||||
// Send and receive a bunch of data.
|
||||
size_t sent_size = 0;
|
||||
@ -741,7 +742,7 @@ void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
EXPECT_LE(sent, unsent_size);
|
||||
sent_size += sent;
|
||||
if (max_send_size >= 0) {
|
||||
EXPECT_LE(static_cast<ssize_t>(sent), max_send_size);
|
||||
EXPECT_LE(static_cast<ptrdiff_t>(sent), max_send_size);
|
||||
if (sent < unsent_size) {
|
||||
// If max_send_size is limiting the amount to send per call such
|
||||
// that the sent amount is less than the unsent amount, we simulate
|
||||
@ -766,8 +767,7 @@ void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
}
|
||||
|
||||
// Receive as much as we can get in a single recv call.
|
||||
char recved_data[data_size];
|
||||
int recved_size = receiver->Recv(recved_data, data_size, nullptr);
|
||||
int recved_size = receiver->Recv(recved_data.data(), data_size, nullptr);
|
||||
|
||||
if (!recv_called) {
|
||||
// The first Recv() after getting readability should succeed and receive
|
||||
@ -780,7 +780,7 @@ void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
if (recved_size >= 0) {
|
||||
EXPECT_LE(static_cast<size_t>(recved_size),
|
||||
sent_size - recv_buffer.size());
|
||||
recv_buffer.AppendData(recved_data, recved_size);
|
||||
recv_buffer.AppendData(recved_data.data(), recved_size);
|
||||
} else {
|
||||
ASSERT_TRUE(receiver->IsBlocking());
|
||||
readable = false;
|
||||
@ -790,7 +790,7 @@ void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
// Once all that we've sent has been received, expect to be able to send
|
||||
// again.
|
||||
if (!writable) {
|
||||
EXPECT_TRUE_WAIT(sink.Check(sender.get(), testing::SSE_WRITE),
|
||||
ASSERT_TRUE_WAIT(sink.Check(sender.get(), testing::SSE_WRITE),
|
||||
kTimeout);
|
||||
writable = true;
|
||||
send_called = false;
|
||||
|
||||
@ -65,7 +65,7 @@ class SocketTest : public testing::Test {
|
||||
|
||||
protected:
|
||||
void TcpInternal(const IPAddress& loopback, size_t data_size,
|
||||
ssize_t max_send_size);
|
||||
ptrdiff_t max_send_size);
|
||||
|
||||
private:
|
||||
void ConnectInternal(const IPAddress& loopback);
|
||||
|
||||
@ -30,8 +30,8 @@ TEST(Win32SocketServerTest, TestPump) {
|
||||
server.Pump();
|
||||
MSG msg;
|
||||
EXPECT_EQ(TRUE, PeekMessage(&msg, NULL, WM_USER, 0, PM_REMOVE));
|
||||
EXPECT_EQ(WM_USER, msg.message);
|
||||
EXPECT_EQ(999, msg.wParam);
|
||||
EXPECT_EQ(static_cast<UINT>(WM_USER), msg.message);
|
||||
EXPECT_EQ(999u, msg.wParam);
|
||||
}
|
||||
|
||||
// Test that Win32Socket passes all the generic Socket tests.
|
||||
|
||||
@ -471,6 +471,9 @@
|
||||
'type': '<(gtest_target_type)',
|
||||
'sources': [
|
||||
'base/nullsocketserver_unittest.cc',
|
||||
'base/physicalsocketserver_unittest.cc',
|
||||
'base/socket_unittest.cc',
|
||||
'base/socket_unittest.h',
|
||||
'base/socketaddress_unittest.cc',
|
||||
'base/virtualsocket_unittest.cc',
|
||||
],
|
||||
@ -490,17 +493,7 @@
|
||||
}],
|
||||
['OS=="win"', {
|
||||
'sources': [
|
||||
# TODO(ronghuawu): Fix TestUdpReadyToSendIPv6 on windows bot
|
||||
# then reenable these tests.
|
||||
# 'base/win32socketserver_unittest.cc',
|
||||
],
|
||||
}, {
|
||||
# TODO(pbos): Move test disabling to ifdefs within the test files
|
||||
# instead of here.
|
||||
'sources': [
|
||||
'base/physicalsocketserver_unittest.cc',
|
||||
'base/socket_unittest.cc',
|
||||
'base/socket_unittest.h',
|
||||
'base/win32socketserver_unittest.cc',
|
||||
],
|
||||
}],
|
||||
['OS=="mac"', {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user