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

Unified Diff: net/spdy/hpack/hpack_decoder_test.cc

Issue 1273743002: Add CompareSpdyHeaderBlocks() test helper method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/spdy/fuzzing/hpack_fuzz_util_test.cc ('k') | net/spdy/hpack/hpack_round_trip_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack/hpack_decoder_test.cc
diff --git a/net/spdy/hpack/hpack_decoder_test.cc b/net/spdy/hpack/hpack_decoder_test.cc
index b20a9b27a9af53dcb09196ebc250f6f72be6aa79..0052edadd5995f7e5fd9209f52276c9e2e9421f1 100644
--- a/net/spdy/hpack/hpack_decoder_test.cc
+++ b/net/spdy/hpack/hpack_decoder_test.cc
@@ -18,7 +18,6 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
-
namespace test {
using base::StringPiece;
@@ -48,8 +47,6 @@ class HpackDecoderPeer {
HpackDecoder* decoder_;
};
-} // namespace test
-
namespace {
using base::StringPiece;
@@ -209,13 +206,13 @@ TEST_F(HpackDecoderTest, IndexedHeaderStatic) {
SpdyHeaderBlock expected_header_set1;
expected_header_set1[":method"] = "GET";
expected_header_set1[":path"] = "/index.html";
- EXPECT_EQ(expected_header_set1, header_set1);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set1, header_set1));
// Reference static table entry #2.
SpdyHeaderBlock header_set2 = DecodeBlockExpectingSuccess("\x82");
SpdyHeaderBlock expected_header_set2;
expected_header_set2[":method"] = "GET";
- EXPECT_EQ(expected_header_set2, header_set2);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set2, header_set2));
}
TEST_F(HpackDecoderTest, IndexedHeaderDynamic) {
@@ -227,7 +224,7 @@ TEST_F(HpackDecoderTest, IndexedHeaderDynamic) {
"bar");
SpdyHeaderBlock expected_header_set1;
expected_header_set1["foo"] = "bar";
- EXPECT_EQ(expected_header_set1, header_set1);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set1, header_set1));
// Second header block: add another entry to header table.
SpdyHeaderBlock header_set2 = DecodeBlockExpectingSuccess(
@@ -238,13 +235,13 @@ TEST_F(HpackDecoderTest, IndexedHeaderDynamic) {
SpdyHeaderBlock expected_header_set2;
expected_header_set2["foo"] = "bar";
expected_header_set2["spam"] = "eggs";
- EXPECT_EQ(expected_header_set2, header_set2);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set2, header_set2));
// Third header block: refer to most recently added entry.
SpdyHeaderBlock header_set3 = DecodeBlockExpectingSuccess("\xbe");
SpdyHeaderBlock expected_header_set3;
expected_header_set3["spam"] = "eggs";
- EXPECT_EQ(expected_header_set3, header_set3);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set3, header_set3));
}
// Test a too-large indexed header.
@@ -320,7 +317,7 @@ TEST_F(HpackDecoderTest, LiteralHeaderNoIndexing) {
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
expected_header_set[":path2"] = "/sample/path/2";
- EXPECT_EQ(expected_header_set, header_set);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set, header_set));
}
// Decoding two valid encoded literal headers with incremental
@@ -333,7 +330,7 @@ TEST_F(HpackDecoderTest, LiteralHeaderIncrementalIndexing) {
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
expected_header_set[":path2"] = "/sample/path/2";
- EXPECT_EQ(expected_header_set, header_set);
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set, header_set));
}
TEST_F(HpackDecoderTest, LiteralHeaderWithIndexingInvalidNameIndex) {
@@ -374,7 +371,7 @@ TEST_F(HpackDecoderTest, BasicE21) {
encoder.EncodeHeaderSet(expected_header_set, &encoded_header_set));
EXPECT_TRUE(DecodeHeaderBlock(encoded_header_set));
- EXPECT_EQ(expected_header_set, decoded_block());
+ EXPECT_TRUE(CompareSpdyHeaderBlocks(expected_header_set, decoded_block()));
}
TEST_F(HpackDecoderTest, SectionD4RequestHuffmanExamples) {
@@ -668,5 +665,5 @@ TEST_F(HpackDecoderTest, SectionD6ResponseHuffmanExamples) {
}
} // namespace
-
+} // namespace test
} // namespace net
« no previous file with comments | « net/spdy/fuzzing/hpack_fuzz_util_test.cc ('k') | net/spdy/hpack/hpack_round_trip_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698