Add explicit |forceOnlineSignin| to user pod status
[chromium-blink-merge.git] / net / quic / quic_spdy_compressor_test.cc
blob93066f290911d8c160dff44f60ca14b1e98ffcbf
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include <string>
7 #include "net/quic/quic_spdy_compressor.h"
8 #include "net/quic/quic_spdy_decompressor.h"
9 #include "net/quic/spdy_utils.h"
10 #include "net/quic/test_tools/quic_test_utils.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 using std::string;
15 namespace net {
16 namespace test {
17 namespace {
19 class QuicSpdyCompressorTest : public ::testing::Test {
20 protected:
21 TestDecompressorVisitor visitor_;
24 TEST_F(QuicSpdyCompressorTest, Compress) {
25 QuicSpdyCompressor compressor;
26 QuicSpdyDecompressor decompressor;
28 SpdyHeaderBlock headers;
29 headers[":host"] = "www.google.com";
30 headers[":path"] = "/index.hml";
31 headers[":scheme"] = "https";
33 string compressed_headers = compressor.CompressHeaders(headers);
34 EXPECT_EQ('\1', compressed_headers[0]);
35 EXPECT_EQ('\0', compressed_headers[1]);
36 EXPECT_EQ('\0', compressed_headers[2]);
37 EXPECT_EQ('\0', compressed_headers[3]);
38 string compressed_data = compressed_headers.substr(4);
39 decompressor.DecompressData(compressed_data, &visitor_);
40 EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers),
41 visitor_.data());
44 } // namespace
45 } // namespace test
46 } // namespace net