Landing Recent QUIC changes until 05/20/2015.

relnote: n/a. Added CloseFecGroup() method to close FEC group.

CloseFecGroup() could be used to close the FEC group without sending
a FEC packet.

This will be used in the next CL's when we will protect everything but
will send FEC packet during quiescence (when FEC timer goes off at the
tail).

Merge internal change: 94002870
https://codereview.chromium.org/1152513005/

relnote:  Protected by FLAGS_enable_quic_stateless_reject_support.
Caches the server nonce between SREJ and subsequent CHLO.

Added support for cacheing the server nonce on receipt of an SREJ and
using it in the subseuent CHLO.

Without this change, the CHLO following an SREJ appears to be a 0-RTT
handshake to the server.  One immediate consequence is that, in our
tests, if strike_register_no_startup_period_ is false, then
strike-register verification will fail on all the stateless 1-RTT CHLO
tests.  Now a CHLO after an SREJ will be accepted by the server,
similar to any other 1-RTT CHLO.

Merge internal change: 93999530
https://codereview.chromium.org/1154613004/

Miscellaneous improvements to comments and formatting.

relnote: n/a (no code changes)

Merge internal change: 93924296
https://codereview.chromium.org/1156623003/

Fix TSAN problem in ../tools/quic/end_to_end_test caused in internal
change: 93767230.

relnote:  n/a (changes only in tests)

Merge internal change: 93901684
https://codereview.chromium.org/1158543003/

Add tests to verify that unless an erroneous packet can be reliably
attributed to a connection, it does not cause any connection to be
terminated.

(The existing test tools/quic:quic_client_session_test/InvalidFramedPacketReceived
is part of this set.)

relnote: no behavior changes (test changes only)

Feature request b/17972234.  Related to b/17206611.

FIXED=17972234

Merge internal change: 93767230
https://codereview.chromium.org/1158563002/

Fix counter in client for tracking implicitly created server-generated
stream IDs. Add a test for the fix. Remove a redundant test in a loop.

relnote: n/a (client behavior changes but no server behavior changes).

Merge internal change: 93746729
https://codereview.chromium.org/1151763005/

Correct spelling of error message in quic_client_bin.cc and
quic_simple_client_bin.cc.

Merge internal change: 93745432
https://codereview.chromium.org/1156803002/

QUIC - minor format change from "git format cl net" found while comparing
internal source with chromium source.

Merge internal change: 93739937
https://codereview.chromium.org/1155493004/

Update methods for creating encrypted packets for tests.
Add tests to verify that those methods work as expected.
Add "static" comments to some static methods in quic_framer_peer.cc.

Related to b/17206611 and b/17972234.

relnote: no behavior changes (test changes only)

Merge internal change: 93724003
https://codereview.chromium.org/1156593003/

Changing the QUIC client to actually disconnect on teardown, and to
clean up without calling the virtual CleanUpUDPSocket in the destructor.

The former was causing problems for the UDP proxy session, because the
virtual CleanUpUDPSocket wasn't being applied and the fd was closed
unexpedtedly.

Fixing a double-close bug in UDP proxy code.  Feature off in prod.

Merge internal change: 93711285
https://codereview.chromium.org/1156643003/

[email protected]

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

Cr-Commit-Position: refs/heads/master@{#331253}
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 676a37d..5f687b2 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -576,13 +576,22 @@
   header.fec_flag = false;
   header.is_in_fec_group = NOT_IN_FEC_GROUP;
   header.fec_group = 0;
+  QuicStreamFrame stream_frame(1, false, 0, MakeIOVector(data));
+  QuicFrame frame(&stream_frame);
   QuicFrames frames;
-  QuicFramer framer(versions ? *versions : QuicSupportedVersions(),
+  frames.push_back(frame);
+  QuicFramer framer(versions != nullptr ? *versions : QuicSupportedVersions(),
                     QuicTime::Zero(), Perspective::IS_CLIENT);
-  // Build a packet with zero frames, which is an error.
+
   scoped_ptr<QuicPacket> packet(
       BuildUnsizedDataPacket(&framer, header, frames));
   EXPECT_TRUE(packet != nullptr);
+
+  // Now set the packet's private flags byte to 0xFF, which is an invalid value.
+  reinterpret_cast<unsigned char*>(
+      packet->mutable_data())[GetStartOfEncryptedData(
+      connection_id_length, version_flag, sequence_number_length)] = 0xFF;
+
   char buffer[kMaxPacketSize];
   scoped_ptr<QuicEncryptedPacket> encrypted(framer.EncryptPacket(
       ENCRYPTION_NONE, sequence_number, *packet, buffer, kMaxPacketSize));