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

Unified Diff: net/spdy/fuzzing/hpack_fuzz_util_test.cc

Issue 265763011: Land recent SPDY changes (through 66310528) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/data/spdy_tests/examples_07.hpack ('k') | net/spdy/hpack_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/fuzzing/hpack_fuzz_util_test.cc
diff --git a/net/spdy/fuzzing/hpack_fuzz_util_test.cc b/net/spdy/fuzzing/hpack_fuzz_util_test.cc
index ebf400ce999bd6c17b60ff8656959def8ee82b01..8956684ce9672f797f34ba356cba674d6ef1d187 100644
--- a/net/spdy/fuzzing/hpack_fuzz_util_test.cc
+++ b/net/spdy/fuzzing/hpack_fuzz_util_test.cc
@@ -10,14 +10,18 @@
#include "base/file_util.h"
#include "base/files/file.h"
#include "base/path_service.h"
+#include "net/spdy/spdy_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
+namespace {
+
using base::StringPiece;
using std::map;
using std::string;
+using test::a2b_hex;
TEST(HpackFuzzUtilTest, GeneratorContextInitialization) {
HpackFuzzUtil::GeneratorContext context;
@@ -91,15 +95,13 @@ TEST(HpackFuzzUtilTest, SerializedHeaderBlockPrefixes) {
TEST(HpackFuzzUtilTest, PassValidInputThroughAllStages) {
// Example lifted from HpackDecoderTest.SectionD3RequestHuffmanExamples.
- char input[] =
- "\x82\x87\x86\x04\x8b\xdb\x6d\x88\x3e\x68\xd1\xcb\x12\x25\xba\x7f";
+ string input = a2b_hex("828786448ce7cf9bebe89b6fb16fa9b6ff");
HpackFuzzUtil::FuzzerContext context;
HpackFuzzUtil::InitializeFuzzerContext(&context);
- EXPECT_TRUE(HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages(
- &context,
- StringPiece(input, arraysize(input) - 1)));
+ EXPECT_TRUE(
+ HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages(&context, input));
std::map<string, string> expect;
expect[":method"] = "GET";
@@ -119,7 +121,7 @@ TEST(HpackFuzzUtilTest, ValidFuzzExamplesRegressionTest) {
source_root.Append(FILE_PATH_LITERAL("net"))
.Append(FILE_PATH_LITERAL("data"))
.Append(FILE_PATH_LITERAL("spdy_tests"))
- .Append(FILE_PATH_LITERAL("examples.hpack")),
+ .Append(FILE_PATH_LITERAL("examples_07.hpack")),
&input.input));
HpackFuzzUtil::FuzzerContext context;
@@ -144,4 +146,6 @@ TEST(HpackFuzzUtilTest, FlipBitsMutatesBuffer) {
EXPECT_NE(unmodified, buffer);
}
+} // namespace
+
} // namespace net
« no previous file with comments | « net/data/spdy_tests/examples_07.hpack ('k') | net/spdy/hpack_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698