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

Unified Diff: net/quic/quic_spdy_decompressor_test.cc

Issue 185203003: Killing off QUICv12, including cleaning out all of the code for handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted unused StripUint32 Created 6 years, 10 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_spdy_decompressor.cc ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_spdy_decompressor_test.cc
diff --git a/net/quic/quic_spdy_decompressor_test.cc b/net/quic/quic_spdy_decompressor_test.cc
deleted file mode 100644
index de9156bdfa4d327fdfa64847457adfec156a353d..0000000000000000000000000000000000000000
--- a/net/quic/quic_spdy_decompressor_test.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <string>
-
-#include "net/quic/quic_spdy_compressor.h"
-#include "net/quic/quic_spdy_decompressor.h"
-#include "net/quic/spdy_utils.h"
-#include "net/quic/test_tools/quic_test_utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using std::string;
-
-namespace net {
-namespace test {
-namespace {
-
-class QuicSpdyDecompressorTest : public ::testing::Test {
- protected:
- QuicSpdyDecompressor decompressor_;
- QuicSpdyCompressor compressor_;
- TestDecompressorVisitor visitor_;
-};
-
-TEST_F(QuicSpdyDecompressorTest, Decompress) {
- SpdyHeaderBlock headers;
- headers[":host"] = "www.google.com";
- headers[":path"] = "/index.hml";
- headers[":scheme"] = "https";
-
- EXPECT_EQ(1u, decompressor_.current_header_id());
- string compressed_headers = compressor_.CompressHeaders(headers).substr(4);
- EXPECT_EQ(compressed_headers.length(),
- decompressor_.DecompressData(compressed_headers, &visitor_));
-
- EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers), visitor_.data());
- EXPECT_EQ(2u, decompressor_.current_header_id());
-}
-
-TEST_F(QuicSpdyDecompressorTest, DecompressPartial) {
- SpdyHeaderBlock headers;
- headers[":host"] = "www.google.com";
- headers[":path"] = "/index.hml";
- headers[":scheme"] = "https";
- string compressed_headers = compressor_.CompressHeaders(headers).substr(4);
-
- for (size_t i = 0; i < compressed_headers.length(); ++i) {
- QuicSpdyDecompressor decompressor;
- TestDecompressorVisitor visitor;
-
- EXPECT_EQ(1u, decompressor.current_header_id());
-
- string partial_compressed_headers = compressed_headers.substr(0, i);
- EXPECT_EQ(partial_compressed_headers.length(),
- decompressor.DecompressData(partial_compressed_headers,
- &visitor));
- EXPECT_EQ(1u, decompressor.current_header_id()) << "i: " << i;
-
- string remaining_compressed_headers =
- compressed_headers.substr(partial_compressed_headers.length());
- EXPECT_EQ(remaining_compressed_headers.length(),
- decompressor.DecompressData(remaining_compressed_headers,
- &visitor));
- EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers), visitor.data());
-
- EXPECT_EQ(2u, decompressor.current_header_id());
- }
-}
-
-TEST_F(QuicSpdyDecompressorTest, DecompressAndIgnoreTrailingData) {
- SpdyHeaderBlock headers;
- headers[":host"] = "www.google.com";
- headers[":path"] = "/index.hml";
- headers[":scheme"] = "https";
-
- string compressed_headers = compressor_.CompressHeaders(headers).substr(4);
- EXPECT_EQ(compressed_headers.length(),
- decompressor_.DecompressData(compressed_headers + "abc123",
- &visitor_));
-
- EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers), visitor_.data());
-}
-
-TEST_F(QuicSpdyDecompressorTest, DecompressError) {
- SpdyHeaderBlock headers;
- headers[":host"] = "www.google.com";
- headers[":path"] = "/index.hml";
- headers[":scheme"] = "https";
-
- EXPECT_EQ(1u, decompressor_.current_header_id());
- string compressed_headers = compressor_.CompressHeaders(headers).substr(4);
- compressed_headers[compressed_headers.length() - 1] ^= 0x01;
- EXPECT_NE(compressed_headers.length(),
- decompressor_.DecompressData(compressed_headers, &visitor_));
-
- EXPECT_TRUE(visitor_.error());
- EXPECT_EQ("", visitor_.data());
-}
-
-} // namespace
-} // namespace test
-} // namespace net
« no previous file with comments | « net/quic/quic_spdy_decompressor.cc ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698