Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: net/quic/quic_network_transaction_unittest.cc

Issue 1576353011: QUIC - When write fails durin sending headers (WriteHeaders call) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_http_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_network_transaction_unittest.cc
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index e4ccdc71331261647a033c3a506ac0a71dcfd38a..d6f5c3c2c462462ddd31826e7520579e2ef13b48 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -10,6 +10,7 @@
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
+#include "net/base/chunked_upload_data_stream.h"
#include "net/base/network_quality_estimator.h"
#include "net/base/socket_performance_watcher.h"
#include "net/base/test_completion_callback.h"
@@ -2259,5 +2260,34 @@ TEST_P(QuicNetworkTransactionTest, SecureResourceOverSecureQuic) {
EXPECT_TRUE(rtt_observer_.rtt_notification_received());
}
+TEST_P(QuicNetworkTransactionTest, QuicUpload) {
+ params_.origin_to_force_quic_on =
+ HostPortPair::FromString("mail.example.com:443");
+
+ MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
+ MockWrite writes[] = {MockWrite(SYNCHRONOUS, ERR_FAILED, 1)};
+ SequencedSocketData socket_data(reads, arraysize(reads), writes,
+ arraysize(writes));
+ socket_factory_.AddSocketDataProvider(&socket_data);
+
+ // The non-alternate protocol job needs to hang in order to guarantee that
+ // the alternate-protocol job will "win".
+ AddHangingNonAlternateProtocolSocketData();
+
+ CreateSession();
+ request_.method = "POST";
+ ChunkedUploadDataStream upload_data(0);
+ upload_data.AppendData("1", 1, true);
+
+ request_.upload_data_stream = &upload_data;
+
+ scoped_ptr<HttpNetworkTransaction> trans(
+ new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get()));
+ TestCompletionCallback callback;
+ int rv = trans->Start(&request_, callback.callback(), net_log_.bound());
+ EXPECT_EQ(ERR_IO_PENDING, rv);
+ EXPECT_NE(OK, callback.WaitForResult());
+}
+
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_http_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698