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

Unified Diff: net/quic/quic_spdy_compressor_test.cc

Issue 14651009: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integer constant is too large for 'unsigned long' type Created 7 years, 7 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_compressor.cc ('k') | net/quic/quic_spdy_decompressor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_spdy_compressor_test.cc
diff --git a/net/quic/quic_spdy_compressor_test.cc b/net/quic/quic_spdy_compressor_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..93066f290911d8c160dff44f60ca14b1e98ffcbf
--- /dev/null
+++ b/net/quic/quic_spdy_compressor_test.cc
@@ -0,0 +1,46 @@
+// 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 QuicSpdyCompressorTest : public ::testing::Test {
+ protected:
+ TestDecompressorVisitor visitor_;
+};
+
+TEST_F(QuicSpdyCompressorTest, Compress) {
+ QuicSpdyCompressor compressor;
+ QuicSpdyDecompressor decompressor;
+
+ SpdyHeaderBlock headers;
+ headers[":host"] = "www.google.com";
+ headers[":path"] = "/index.hml";
+ headers[":scheme"] = "https";
+
+ string compressed_headers = compressor.CompressHeaders(headers);
+ EXPECT_EQ('\1', compressed_headers[0]);
+ EXPECT_EQ('\0', compressed_headers[1]);
+ EXPECT_EQ('\0', compressed_headers[2]);
+ EXPECT_EQ('\0', compressed_headers[3]);
+ string compressed_data = compressed_headers.substr(4);
+ decompressor.DecompressData(compressed_data, &visitor_);
+ EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers),
+ visitor_.data());
+}
+
+} // namespace
+} // namespace test
+} // namespace net
« no previous file with comments | « net/quic/quic_spdy_compressor.cc ('k') | net/quic/quic_spdy_decompressor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698