summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 02:31:13 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 02:31:13 +0000
commit74101259c1f4358fe37f54921bd39ce9ec604bd8 (patch)
tree99e7565490f6944bdc60e86c2912015c5d94974a /remoting
parent7eb68a27b4edcf33b6f8edeb5a133d7397409cd8 (diff)
downloadchromium_src-74101259c1f4358fe37f54921bd39ce9ec604bd8.zip
chromium_src-74101259c1f4358fe37f54921bd39ce9ec604bd8.tar.gz
chromium_src-74101259c1f4358fe37f54921bd39ce9ec604bd8.tar.bz2
Fix races in JingleChromotingConnectionTest.
BUG=57692 TEST=remoting_unittests under TSan. Review URL: http://codereview.chromium.org/3541010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61469 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/protocol/jingle_chromoting_connection_unittest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/remoting/protocol/jingle_chromoting_connection_unittest.cc b/remoting/protocol/jingle_chromoting_connection_unittest.cc
index a517592..187f885 100644
--- a/remoting/protocol/jingle_chromoting_connection_unittest.cc
+++ b/remoting/protocol/jingle_chromoting_connection_unittest.cc
@@ -286,14 +286,13 @@ class TCPChannelTester : public ChannelTesterBase {
EXPECT_EQ(0, write_errors_);
EXPECT_EQ(0, read_errors_);
- input_buffer_->set_offset(0);
ASSERT_EQ(kTestDataSize + kMessageSize, input_buffer_->capacity());
output_buffer_->SetOffset(0);
ASSERT_EQ(kTestDataSize, output_buffer_->size());
EXPECT_EQ(0, memcmp(output_buffer_->data(),
- input_buffer_->data(), kTestDataSize));
+ input_buffer_->StartOfBuffer(), kTestDataSize));
}
protected:
@@ -347,7 +346,8 @@ class TCPChannelTester : public ChannelTesterBase {
void OnRead(int result) {
HandleReadResult(result);
- DoRead();
+ if (!done_event_.IsSignaled())
+ DoRead(); // Don't try to read again when we are done reading.
}
void HandleReadResult(int result) {