Implement a QuicHeadersStream to handle reliable in-order delivery of
headers.

Changes the way headers are delivered in QUIC from being the first bytes
on a stream, to being delivered as SPDY SYN_STREAM/SYN_REPLY frames on
a dedicated headers stream.  This also creates QUIC_VERSION_13.  Since
the intra-stream serialization format changes, it is not possible for a
client to handle a version negotiation across this boundary.

Merge internal change: 58313427

[email protected]

Review URL: https://codereview.chromium.org/116513003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241682 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/quic/quic_client_session_test.cc b/net/quic/quic_client_session_test.cc
index f0b4dd4..2606db7 100644
--- a/net/quic/quic_client_session_test.cc
+++ b/net/quic/quic_client_session_test.cc
@@ -61,11 +61,12 @@
   QuicPacketHeader header_;
 };
 
-class QuicClientSessionTest : public ::testing::Test {
+class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> {
  protected:
   QuicClientSessionTest()
       : writer_(new TestPacketWriter()),
-        connection_(new PacketSavingConnection(false)),
+        connection_(new PacketSavingConnection(false,
+                                               SupportedVersions(GetParam()))),
         session_(connection_, GetSocket().Pass(), writer_.Pass(), NULL, NULL,
                  kServerHostname, DefaultQuicConfig(), &crypto_config_,
                  &net_log_) {
@@ -105,11 +106,14 @@
   QuicCryptoClientConfig crypto_config_;
 };
 
-TEST_F(QuicClientSessionTest, CryptoConnect) {
+INSTANTIATE_TEST_CASE_P(Tests, QuicClientSessionTest,
+                        ::testing::ValuesIn(QuicSupportedVersions()));
+
+TEST_P(QuicClientSessionTest, CryptoConnect) {
   CompleteCryptoHandshake();
 }
 
-TEST_F(QuicClientSessionTest, MaxNumStreams) {
+TEST_P(QuicClientSessionTest, MaxNumStreams) {
   CompleteCryptoHandshake();
 
   std::vector<QuicReliableClientStream*> streams;
@@ -125,7 +129,7 @@
   EXPECT_TRUE(session_.CreateOutgoingDataStream());
 }
 
-TEST_F(QuicClientSessionTest, MaxNumStreamsViaRequest) {
+TEST_P(QuicClientSessionTest, MaxNumStreamsViaRequest) {
   CompleteCryptoHandshake();
 
   std::vector<QuicReliableClientStream*> streams;
@@ -149,7 +153,7 @@
   EXPECT_TRUE(stream != NULL);
 }
 
-TEST_F(QuicClientSessionTest, GoAwayReceived) {
+TEST_P(QuicClientSessionTest, GoAwayReceived) {
   CompleteCryptoHandshake();
 
   // After receiving a GoAway, I should no longer be able to create outgoing