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

Side by Side Diff: net/quic/quic_spdy_decompressor_test.cc

Issue 15074007: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_spdy_decompressor.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "net/quic/quic_spdy_compressor.h" 7 #include "net/quic/quic_spdy_compressor.h"
8 #include "net/quic/quic_spdy_decompressor.h" 8 #include "net/quic/quic_spdy_decompressor.h"
9 #include "net/quic/spdy_utils.h" 9 #include "net/quic/spdy_utils.h"
10 #include "net/quic/test_tools/quic_test_utils.h" 10 #include "net/quic/test_tools/quic_test_utils.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 headers[":scheme"] = "https"; 45 headers[":scheme"] = "https";
46 46
47 string compressed_headers = compressor_.CompressHeaders(headers).substr(4); 47 string compressed_headers = compressor_.CompressHeaders(headers).substr(4);
48 EXPECT_EQ(compressed_headers.length(), 48 EXPECT_EQ(compressed_headers.length(),
49 decompressor_.DecompressData(compressed_headers + "abc123", 49 decompressor_.DecompressData(compressed_headers + "abc123",
50 &visitor_)); 50 &visitor_));
51 51
52 EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers), visitor_.data()); 52 EXPECT_EQ(SpdyUtils::SerializeUncompressedHeaders(headers), visitor_.data());
53 } 53 }
54 54
55 TEST_F(QuicSpdyDecompressorTest, DecompressError) {
56 SpdyHeaderBlock headers;
57 headers[":host"] = "www.google.com";
58 headers[":path"] = "/index.hml";
59 headers[":scheme"] = "https";
60
61 EXPECT_EQ(1u, decompressor_.current_header_id());
62 string compressed_headers = compressor_.CompressHeaders(headers).substr(4);
63 compressed_headers[compressed_headers.length() - 1] ^= 0x01;
64 EXPECT_NE(compressed_headers.length(),
65 decompressor_.DecompressData(compressed_headers, &visitor_));
66
67 EXPECT_TRUE(visitor_.error());
68 EXPECT_EQ("", visitor_.data());
69 }
70
55 } // namespace 71 } // namespace
56 } // namespace test 72 } // namespace test
57 } // namespace net 73 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_decompressor.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698