diff options
author | erikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 20:54:07 +0000 |
---|---|---|
committer | erikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 20:54:07 +0000 |
commit | 0107dbdf9eaa3d5c60d070c1ccfaee2972bdfec3 (patch) | |
tree | e29490bb35672e3703c4da61687489db757b572f /net | |
parent | e7ad932e9a04827ef75dc8c8975be25719ab9462 (diff) | |
download | chromium_src-0107dbdf9eaa3d5c60d070c1ccfaee2972bdfec3.zip chromium_src-0107dbdf9eaa3d5c60d070c1ccfaee2972bdfec3.tar.gz chromium_src-0107dbdf9eaa3d5c60d070c1ccfaee2972bdfec3.tar.bz2 |
Fix SpdyHttpStreamTest windows tsan bug.
BUG=50929
TEST=net_unittests
Review URL: http://codereview.chromium.org/2836079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/data/valgrind/net_unittests.gtest-tsan_win32.txt | 3 | ||||
-rw-r--r-- | net/spdy/spdy_http_stream_unittest.cc | 20 |
2 files changed, 14 insertions, 9 deletions
diff --git a/net/data/valgrind/net_unittests.gtest-tsan_win32.txt b/net/data/valgrind/net_unittests.gtest-tsan_win32.txt index 9126e68..0fc6d3c 100644 --- a/net/data/valgrind/net_unittests.gtest-tsan_win32.txt +++ b/net/data/valgrind/net_unittests.gtest-tsan_win32.txt @@ -14,9 +14,6 @@ DiskCacheBackendTest.* # See http://crbug.com/47836 ClientSocketPoolBaseTest.CancelPendingSocketAtSocketLimit -# See http://crbug.com/50929 -SpdyHttpStreamTest.SpdyURLTest - ######################################### # These tests fail if you don't have our SSL certificate installed. # Please see http://dev.chromium.org/developers/testing#TOC-SSL-tests diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc index 7f78142..1287820 100644 --- a/net/spdy/spdy_http_stream_unittest.cc +++ b/net/spdy/spdy_http_stream_unittest.cc @@ -47,7 +47,6 @@ TEST_F(SpdyHttpStreamTest, SendRequest) { EnableCompression(false); SpdySession::SetSSLMode(false); - SpdySessionDependencies session_deps; scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); MockWrite writes[] = { CreateMockWrite(*req.get(), 1), @@ -102,8 +101,10 @@ TEST_F(SpdyHttpStreamTest, SpdyURLTest) { MockWrite writes[] = { CreateMockWrite(*req.get(), 1), }; + scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); MockRead reads[] = { - MockRead(false, 0, 2), // EOF + CreateMockRead(*resp, 2), + MockRead(false, 0, 3) // EOF }; HostPortPair host_port_pair("www.google.com", 80); @@ -133,10 +134,17 @@ TEST_F(SpdyHttpStreamTest, SpdyURLTest) { else FAIL() << "No url is set in spdy_header!"; - MessageLoop::current()->RunAllPending(); - EXPECT_TRUE(http_session_->spdy_session_pool()->HasSession(pair)); - http_session_->spdy_session_pool()->CloseAllSessions(); - EXPECT_TRUE(!data()->at_read_eof()); + // This triggers the MockWrite and read 2 + callback.WaitForResult(); + + // This triggers read 3. The empty read causes the session to shut down. + data()->CompleteRead(); + + // Because we abandoned the stream, we don't expect to find a session in the + // pool anymore. + EXPECT_TRUE(!http_session_->spdy_session_pool()->HasSession(pair)); + EXPECT_TRUE(data()->at_read_eof()); + EXPECT_TRUE(data()->at_write_eof()); } // TODO(willchan): Write a longer test for SpdyStream that exercises all |