diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 11:52:32 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 11:52:32 +0000 |
commit | ca124cb259a9c4c263da00b4f5fedebf5b58234a (patch) | |
tree | 447062c6f506a9496d6fcc06531e01b7e2717412 /net | |
parent | aa1d6a04526d76040ef2c0d5ee68f423db1e1333 (diff) | |
download | chromium_src-ca124cb259a9c4c263da00b4f5fedebf5b58234a.zip chromium_src-ca124cb259a9c4c263da00b4f5fedebf5b58234a.tar.gz chromium_src-ca124cb259a9c4c263da00b4f5fedebf5b58234a.tar.bz2 |
Backout test change.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/455001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/flip/flip_network_transaction_unittest.cc | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/net/flip/flip_network_transaction_unittest.cc b/net/flip/flip_network_transaction_unittest.cc index 1962986..767954c 100644 --- a/net/flip/flip_network_transaction_unittest.cc +++ b/net/flip/flip_network_transaction_unittest.cc @@ -184,8 +184,7 @@ class DelayedSocketData : public StaticSocketDataProvider, // e.g. a MockRead(true, 0, 0); DelayedSocketData(MockRead* reads, int write_delay, MockWrite* writes) : StaticSocketDataProvider(reads, writes), - write_delay_(write_delay), - ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { + write_delay_(write_delay) { DCHECK_GE(write_delay_, 0); } @@ -200,26 +199,16 @@ class DelayedSocketData : public StaticSocketDataProvider, // Now that our write has completed, we can allow reads to continue. if (!--write_delay_) MessageLoop::current()->PostDelayedTask(FROM_HERE, - factory_.NewRunnableMethod(&DelayedSocketData::CompleteRead), 100); + NewRunnableMethod(this, &DelayedSocketData::CompleteRead), 100); return rv; } - virtual void Reset() { - set_socket(NULL); - factory_.RevokeAll(); - StaticSocketDataProvider::Reset(); - } - void CompleteRead() { - if (socket()) - socket()->OnReadComplete(GetNextRead()); - else - NOTREACHED(); + socket()->OnReadComplete(GetNextRead()); } private: int write_delay_; - ScopedRunnableMethodFactory<DelayedSocketData> factory_; }; class FlipNetworkTransactionTest : public PlatformTest { @@ -749,7 +738,10 @@ TEST_F(FlipNetworkTransactionTest, DISABLED_ServerPush) { } // Test that we shutdown correctly on write errors. -TEST_F(FlipNetworkTransactionTest, WriteError) { +// TODO(mbelshe): Fix this test. +// The problem is that the async IO can be left hanging in the mock +// socket, which can cause late-arriving events to crash. +TEST_F(FlipNetworkTransactionTest, DISABLED_WriteError) { MockWrite writes[] = { // We'll write 10 bytes successfully MockWrite(true, reinterpret_cast<const char*>(kGetSyn), 10), @@ -773,9 +765,7 @@ TEST_F(FlipNetworkTransactionTest, WriteError) { scoped_refptr<DelayedSocketData> data( new DelayedSocketData(reads, 2, writes)); TransactionHelperResult out = TransactionHelper(request, data.get()); - data->set_socket((net::MockClientSocket *)0xdeadbeef); EXPECT_EQ(ERR_FAILED, out.rv); - //data->Reset(); } // Test that partial writes work. |