summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 18:35:08 +0000
committerronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 18:35:08 +0000
commit836c8975362beb3670717db33e98963c5d2c833e (patch)
tree079bdc30b2a87d5fc6e1353053b97e3dc504f588 /remoting
parent3c21d74b8d7bbe740b21413a378cf83db0abff41 (diff)
downloadchromium_src-836c8975362beb3670717db33e98963c5d2c833e.zip
chromium_src-836c8975362beb3670717db33e98963c5d2c833e.tar.gz
chromium_src-836c8975362beb3670717db33e98963c5d2c833e.tar.bz2
* Remove the dependency to ws2_32.dll from talk_base::ThreadManager and talk_base::Thread.
* Remove the denendency to the htons(), htonl(), ntohs(), ntohl(). * Implement inet_pton_v4 without using ws2. * Update the remoting_unittests. BUG=115501 TEST=Build and run webrtc test on Windows. Review URL: http://codereview.chromium.org/9455070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/protocol/jingle_session_unittest.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc
index 9361da4..a8b9797 100644
--- a/remoting/protocol/jingle_session_unittest.cc
+++ b/remoting/protocol/jingle_session_unittest.cc
@@ -81,8 +81,10 @@ class MockStreamChannelCallback {
class JingleSessionTest : public testing::Test {
public:
- JingleSessionTest()
- : message_loop_(talk_base::Thread::Current()) {
+ JingleSessionTest() {
+ talk_base::ThreadManager::Instance()->WrapCurrentThread();
+ message_loop_.reset(
+ new JingleThreadMessageLoop(talk_base::Thread::Current()));
}
// Helper method that handles OnIncomingSession().
@@ -113,7 +115,7 @@ class JingleSessionTest : public testing::Test {
virtual void TearDown() {
CloseSessions();
CloseSessionManager();
- message_loop_.RunAllPending();
+ message_loop_->RunAllPending();
}
void CloseSessions() {
@@ -224,7 +226,7 @@ class JingleSessionTest : public testing::Test {
base::Bind(&MockSessionCallback::OnStateChange,
base::Unretained(&client_connection_callback_)));
- message_loop_.RunAllPending();
+ message_loop_->RunAllPending();
}
void CreateChannel(bool expect_fail) {
@@ -238,7 +240,7 @@ class JingleSessionTest : public testing::Test {
.WillOnce(QuitThreadOnCounter(&counter));
EXPECT_CALL(host_channel_callback_, OnDone(_))
.WillOnce(QuitThreadOnCounter(&counter));
- message_loop_.Run();
+ message_loop_->Run();
if (expect_fail) {
// At least one socket should fail to connect.
@@ -249,7 +251,7 @@ class JingleSessionTest : public testing::Test {
}
}
- JingleThreadMessageLoop message_loop_;
+ scoped_ptr<JingleThreadMessageLoop> message_loop_;
scoped_ptr<FakeSignalStrategy> host_signal_strategy_;
scoped_ptr<FakeSignalStrategy> client_signal_strategy_;
@@ -305,7 +307,7 @@ TEST_F(JingleSessionTest, RejectConnection) {
base::Bind(&MockSessionCallback::OnStateChange,
base::Unretained(&client_connection_callback_)));
- message_loop_.RunAllPending();
+ message_loop_->RunAllPending();
}
// Verify that we can connect two endpoints with single-step authentication.
@@ -353,7 +355,7 @@ TEST_F(JingleSessionTest, TestStreamChannel) {
StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
kMessageSize, kMessages);
tester.Start();
- message_loop_.Run();
+ message_loop_->Run();
tester.CheckResults();
}
@@ -368,7 +370,7 @@ TEST_F(JingleSessionTest, TestMultistepAuthStreamChannel) {
StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
kMessageSize, kMessages);
tester.Start();
- message_loop_.Run();
+ message_loop_->Run();
tester.CheckResults();
}