Commit fbbcfc63 authored by Victor Vasiliev's avatar Victor Vasiliev Committed by Commit Bot

Reconcile minor differences between google3 and Chromium SPDY

Change-Id: I87b3522aaa82c5e93f0a9032b2b82963f79b11f2
Reviewed-on: https://chromium-review.googlesource.com/c/1297258Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Commit-Queue: Victor Vasiliev <vasilvv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602384}
parent 631450db
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "net/third_party/spdy/core/array_output_buffer.h" #include "net/third_party/spdy/core/array_output_buffer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace spdy { namespace spdy {
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_
#define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <cstdint>
#include <vector> #include <vector>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <stddef.h> #include <stddef.h>
#include <cstdint>
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
......
...@@ -636,7 +636,7 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderNeverIndexedInvalidNameIndex) { ...@@ -636,7 +636,7 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderNeverIndexedInvalidNameIndex) {
TEST_P(HpackDecoderAdapterTest, TruncatedIndex) { TEST_P(HpackDecoderAdapterTest, TruncatedIndex) {
// Indexed Header, varint for index requires multiple bytes, // Indexed Header, varint for index requires multiple bytes,
// but only one provided. // but only one provided.
EXPECT_FALSE(DecodeHeaderBlock(SpdyStringPiece("\xff", 1))); EXPECT_FALSE(DecodeHeaderBlock("\xff"));
} }
TEST_P(HpackDecoderAdapterTest, TruncatedHuffmanLiteral) { TEST_P(HpackDecoderAdapterTest, TruncatedHuffmanLiteral) {
...@@ -1014,8 +1014,8 @@ TEST_P(HpackDecoderAdapterTest, SectionC6ResponseHuffmanExamples) { ...@@ -1014,8 +1014,8 @@ TEST_P(HpackDecoderAdapterTest, SectionC6ResponseHuffmanExamples) {
} }
// Regression test: Found that entries with dynamic indexed names and literal // Regression test: Found that entries with dynamic indexed names and literal
// values caused "use after free" memory sanity checker failures if the name // values caused "use after free" MSAN failures if the name was evicted as it
// was evicted as it was being re-used. // was being re-used.
TEST_P(HpackDecoderAdapterTest, ReuseNameOfEvictedEntry) { TEST_P(HpackDecoderAdapterTest, ReuseNameOfEvictedEntry) {
// Each entry is measured as 32 bytes plus the sum of the lengths of the name // Each entry is measured as 32 bytes plus the sum of the lengths of the name
// and the value. Set the size big enough for at most one entry, and a fairly // and the value. Set the size big enough for at most one entry, and a fairly
......
...@@ -39,7 +39,7 @@ class SPDY_EXPORT_PRIVATE HpackEncoder { ...@@ -39,7 +39,7 @@ class SPDY_EXPORT_PRIVATE HpackEncoder {
// Callers may provide a HeaderListener to be informed of header name-value // Callers may provide a HeaderListener to be informed of header name-value
// pairs processed by this encoder. // pairs processed by this encoder.
typedef std::function<void(SpdyStringPiece, SpdyStringPiece)> HeaderListener; using HeaderListener = std::function<void(SpdyStringPiece, SpdyStringPiece)>;
// An indexing policy should return true if the provided header name-value // An indexing policy should return true if the provided header name-value
// pair should be inserted into the HPACK dynamic table. // pair should be inserted into the HPACK dynamic table.
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "net/third_party/spdy/core/hpack/hpack_entry.h" #include "net/third_party/spdy/core/hpack/hpack_entry.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "net/third_party/spdy/platform/api/spdy_estimate_memory_usage.h" #include "net/third_party/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/third_party/spdy/platform/api/spdy_string_utils.h" #include "net/third_party/spdy/platform/api/spdy_string_utils.h"
...@@ -72,7 +71,6 @@ HpackEntry::~HpackEntry() = default; ...@@ -72,7 +71,6 @@ HpackEntry::~HpackEntry() = default;
size_t HpackEntry::Size(SpdyStringPiece name, SpdyStringPiece value) { size_t HpackEntry::Size(SpdyStringPiece name, SpdyStringPiece value) {
return name.size() + value.size() + kSizeOverhead; return name.size() + value.size() + kSizeOverhead;
} }
size_t HpackEntry::Size() const { size_t HpackEntry::Size() const {
return Size(name(), value()); return Size(name(), value());
} }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_HUFFMAN_TABLE_H_ #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_HUFFMAN_TABLE_H_
#define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_HUFFMAN_TABLE_H_ #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_HUFFMAN_TABLE_H_
#include <stdint.h>
#include <cstddef> #include <cstddef>
#include <cstdint>
#include <vector> #include <vector>
#include "net/third_party/spdy/core/hpack/hpack_constants.h" #include "net/third_party/spdy/core/hpack/hpack_constants.h"
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
#ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_OUTPUT_STREAM_H_ #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_OUTPUT_STREAM_H_
#define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_OUTPUT_STREAM_H_ #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_OUTPUT_STREAM_H_
#include <stddef.h> #include <cstdint>
#include <stdint.h>
#include <map> #include <map>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include <cmath> #include <cmath>
#include <cstdint>
#include <ctime> #include <ctime>
#include <vector> #include <vector>
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_STATIC_TABLE_H_ #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_STATIC_TABLE_H_
#define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_STATIC_TABLE_H_ #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_STATIC_TABLE_H_
#include <stddef.h>
#include "net/third_party/spdy/core/hpack/hpack_header_table.h" #include "net/third_party/spdy/core/hpack/hpack_header_table.h"
#include "net/third_party/spdy/platform/api/spdy_export.h" #include "net/third_party/spdy/platform/api/spdy_export.h"
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
#ifndef NET_THIRD_PARTY_SPDY_CORE_MOCK_SPDY_FRAMER_VISITOR_H_ #ifndef NET_THIRD_PARTY_SPDY_CORE_MOCK_SPDY_FRAMER_VISITOR_H_
#define NET_THIRD_PARTY_SPDY_CORE_MOCK_SPDY_FRAMER_VISITOR_H_ #define NET_THIRD_PARTY_SPDY_CORE_MOCK_SPDY_FRAMER_VISITOR_H_
#include <stddef.h>
#include <stdint.h>
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
......
...@@ -130,7 +130,7 @@ class SpdyTestDeframerImpl : public SpdyTestDeframer, ...@@ -130,7 +130,7 @@ class SpdyTestDeframerImpl : public SpdyTestDeframer,
explicit SpdyTestDeframerImpl( explicit SpdyTestDeframerImpl(
std::unique_ptr<SpdyDeframerVisitorInterface> listener) std::unique_ptr<SpdyDeframerVisitorInterface> listener)
: listener_(std::move(listener)) { : listener_(std::move(listener)) {
CHECK(listener_); CHECK(listener_ != nullptr);
} }
SpdyTestDeframerImpl(const SpdyTestDeframerImpl&) = delete; SpdyTestDeframerImpl(const SpdyTestDeframerImpl&) = delete;
SpdyTestDeframerImpl& operator=(const SpdyTestDeframerImpl&) = delete; SpdyTestDeframerImpl& operator=(const SpdyTestDeframerImpl&) = delete;
...@@ -291,9 +291,9 @@ void SpdyTestDeframerImpl::AtHeadersEnd() { ...@@ -291,9 +291,9 @@ void SpdyTestDeframerImpl::AtHeadersEnd() {
CHECK(end_) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(end_) << " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK(got_hpack_end_); CHECK(got_hpack_end_);
CHECK(headers_ir_); CHECK(headers_ir_ != nullptr);
CHECK(headers_); CHECK(headers_ != nullptr);
CHECK(headers_handler_); CHECK(headers_handler_ != nullptr);
CHECK_LE(0u, padding_len_); CHECK_LE(0u, padding_len_);
CHECK_LE(padding_len_, 256u); CHECK_LE(padding_len_, 256u);
...@@ -318,9 +318,9 @@ void SpdyTestDeframerImpl::AtPushPromiseEnd() { ...@@ -318,9 +318,9 @@ void SpdyTestDeframerImpl::AtPushPromiseEnd() {
<< " frame_type_=" << Http2FrameTypeToString(frame_type_); << " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK(end_) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(end_) << " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK(push_promise_ir_); CHECK(push_promise_ir_ != nullptr);
CHECK(headers_); CHECK(headers_ != nullptr);
CHECK(headers_handler_); CHECK(headers_handler_ != nullptr);
CHECK_EQ(headers_ir_.get(), nullptr); CHECK_EQ(headers_ir_.get(), nullptr);
...@@ -495,7 +495,7 @@ bool SpdyTestDeframerImpl::OnGoAwayFrameData(const char* goaway_data, ...@@ -495,7 +495,7 @@ bool SpdyTestDeframerImpl::OnGoAwayFrameData(const char* goaway_data,
DVLOG(1) << "OnGoAwayFrameData"; DVLOG(1) << "OnGoAwayFrameData";
CHECK_EQ(frame_type_, GOAWAY) CHECK_EQ(frame_type_, GOAWAY)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_); << " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK(goaway_description_); CHECK(goaway_description_ != nullptr);
goaway_description_->append(goaway_data, len); goaway_description_->append(goaway_data, len);
return true; return true;
} }
...@@ -615,7 +615,7 @@ void SpdyTestDeframerImpl::OnSetting(SpdySettingsId id, uint32_t value) { ...@@ -615,7 +615,7 @@ void SpdyTestDeframerImpl::OnSetting(SpdySettingsId id, uint32_t value) {
DVLOG(1) << "OnSetting id: " << id << std::hex << " value: " << value; DVLOG(1) << "OnSetting id: " << id << std::hex << " value: " << value;
CHECK_EQ(frame_type_, SETTINGS) CHECK_EQ(frame_type_, SETTINGS)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_); << " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK(settings_); CHECK(settings_ != nullptr);
SpdyKnownSettingsId known_id; SpdyKnownSettingsId known_id;
if (ParseSettingsId(id, &known_id)) { if (ParseSettingsId(id, &known_id)) {
settings_->push_back(std::make_pair(known_id, value)); settings_->push_back(std::make_pair(known_id, value));
...@@ -753,7 +753,7 @@ bool SpdyTestDeframerImpl::OnUnknownFrame(SpdyStreamId stream_id, ...@@ -753,7 +753,7 @@ bool SpdyTestDeframerImpl::OnUnknownFrame(SpdyStreamId stream_id,
void SpdyTestDeframerImpl::OnHeaderBlockStart() { void SpdyTestDeframerImpl::OnHeaderBlockStart() {
CHECK(frame_type_ == HEADERS || frame_type_ == PUSH_PROMISE) CHECK(frame_type_ == HEADERS || frame_type_ == PUSH_PROMISE)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_); << " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK(headers_); CHECK(headers_ != nullptr);
CHECK_EQ(0u, headers_->size()); CHECK_EQ(0u, headers_->size());
got_hpack_end_ = false; got_hpack_end_ = false;
} }
...@@ -901,24 +901,18 @@ CollectedFrame& CollectedFrame::operator=(CollectedFrame&& other) { ...@@ -901,24 +901,18 @@ CollectedFrame& CollectedFrame::operator=(CollectedFrame&& other) {
return *this; return *this;
} }
AssertionResult CollectedFrame::VerifyHasHeaders( ::testing::AssertionResult CollectedFrame::VerifyHasHeaders(
const StringPairVector& expected_headers) const { const StringPairVector& expected_headers) const {
if (headers.get() == nullptr) VERIFY_NE(headers.get(), nullptr);
return AssertionFailure(); VERIFY_THAT(*headers, ::testing::ContainerEq(expected_headers));
if (*headers != expected_headers) return ::testing::AssertionSuccess();
return AssertionFailure();
return AssertionSuccess();
} }
AssertionResult CollectedFrame::VerifyHasSettings( ::testing::AssertionResult CollectedFrame::VerifyHasSettings(
const SettingVector& expected_settings) const { const SettingVector& expected_settings) const {
if (settings.get() == nullptr) VERIFY_NE(settings.get(), nullptr);
return AssertionFailure(); VERIFY_THAT(*settings, testing::ContainerEq(expected_settings));
if (*settings != expected_settings) return ::testing::AssertionSuccess();
return AssertionFailure();
return AssertionSuccess();
} }
DeframerCallbackCollector::DeframerCallbackCollector( DeframerCallbackCollector::DeframerCallbackCollector(
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
// with the expected frames, which it would pop-off the list as its expectations // with the expected frames, which it would pop-off the list as its expectations
// are met. // are met.
#include <stdint.h> #include <cstdint>
#include <memory> #include <memory>
#include <type_traits> #include <type_traits>
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
#ifndef NET_THIRD_PARTY_SPDY_CORE_SPDY_FRAME_READER_H_ #ifndef NET_THIRD_PARTY_SPDY_CORE_SPDY_FRAME_READER_H_
#define NET_THIRD_PARTY_SPDY_CORE_SPDY_FRAME_READER_H_ #define NET_THIRD_PARTY_SPDY_CORE_SPDY_FRAME_READER_H_
#include <stddef.h> #include <cstdint>
#include <stdint.h>
#include "net/third_party/spdy/platform/api/spdy_export.h" #include "net/third_party/spdy/platform/api/spdy_export.h"
#include "net/third_party/spdy/platform/api/spdy_string_piece.h" #include "net/third_party/spdy/platform/api/spdy_string_piece.h"
......
...@@ -1611,7 +1611,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) { ...@@ -1611,7 +1611,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_)); ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1631,7 +1632,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) { ...@@ -1631,7 +1632,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_)); ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
} }
...@@ -1658,7 +1660,8 @@ TEST_P(SpdyFramerTest, CreateSettings) { ...@@ -1658,7 +1660,8 @@ TEST_P(SpdyFramerTest, CreateSettings) {
ASSERT_TRUE(framer_.SerializeSettings(settings_ir, &output_)); ASSERT_TRUE(framer_.SerializeSettings(settings_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1693,7 +1696,8 @@ TEST_P(SpdyFramerTest, CreateSettings) { ...@@ -1693,7 +1696,8 @@ TEST_P(SpdyFramerTest, CreateSettings) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1712,7 +1716,8 @@ TEST_P(SpdyFramerTest, CreateSettings) { ...@@ -1712,7 +1716,8 @@ TEST_P(SpdyFramerTest, CreateSettings) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
} }
...@@ -1744,7 +1749,8 @@ TEST_P(SpdyFramerTest, CreatePingFrame) { ...@@ -1744,7 +1749,8 @@ TEST_P(SpdyFramerTest, CreatePingFrame) {
ASSERT_TRUE(framer_.SerializePing(ping_ir, &output_)); ASSERT_TRUE(framer_.SerializePing(ping_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
// Tests SpdyPingIR when the ping is an ack. // Tests SpdyPingIR when the ping is an ack.
ping_ir.set_is_ack(true); ping_ir.set_is_ack(true);
...@@ -1778,7 +1784,8 @@ TEST_P(SpdyFramerTest, CreateGoAway) { ...@@ -1778,7 +1784,8 @@ TEST_P(SpdyFramerTest, CreateGoAway) {
ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_)); ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1800,7 +1807,8 @@ TEST_P(SpdyFramerTest, CreateGoAway) { ...@@ -1800,7 +1807,8 @@ TEST_P(SpdyFramerTest, CreateGoAway) {
ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_)); ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
} }
...@@ -1834,7 +1842,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -1834,7 +1842,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers.SetHeader("foo", "bar"); headers.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr)); &framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1865,7 +1874,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -1865,7 +1874,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers.SetHeader("foo", "bar"); headers.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr)); &framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1896,7 +1906,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -1896,7 +1906,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", ""); headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr)); &framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1932,7 +1943,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -1932,7 +1943,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", ""); headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr)); &framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -1971,7 +1983,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -1971,7 +1983,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", ""); headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr)); &framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData, SPDY_ARRAYSIZE(kV4FrameData)); CompareFrame(kDescription, frame, kV4FrameData,
SPDY_ARRAYSIZE(kV4FrameData));
} }
{ {
...@@ -2010,7 +2023,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -2010,7 +2023,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", ""); headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr)); &framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData, SPDY_ARRAYSIZE(kV4FrameData)); CompareFrame(kDescription, frame, kV4FrameData,
SPDY_ARRAYSIZE(kV4FrameData));
} }
{ {
...@@ -2047,7 +2061,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) { ...@@ -2047,7 +2061,8 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.set_padding_len(6); headers_ir.set_padding_len(6);
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders( SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr)); &framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
} }
...@@ -2069,7 +2084,8 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) { ...@@ -2069,7 +2084,8 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 1), &output_)); SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 1), &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -2090,7 +2106,8 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) { ...@@ -2090,7 +2106,8 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
&output_)); &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
{ {
...@@ -2111,7 +2128,8 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) { ...@@ -2111,7 +2128,8 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
&output_)); &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false); frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
} }
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData)); CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
} }
} }
......
// Copyright (c) 2016 The Chromium Authors. All rights reserved. // Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
//
// SpdyNoOpVisitor implements several of the visitor and handler interfaces // SpdyNoOpVisitor implements several of the visitor and handler interfaces
// to make it easier to write tests that need to provide instances. Other // to make it easier to write tests that need to provide instances. Other
// interfaces can be added as needed. // interfaces can be added as needed.
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include <stdint.h>
#include "net/third_party/spdy/core/spdy_protocol_test_utils.h" #include "net/third_party/spdy/core/spdy_protocol_test_utils.h"
#include <cstdint>
#include "net/third_party/spdy/platform/api/spdy_string_piece.h" #include "net/third_party/spdy/platform/api/spdy_string_piece.h"
namespace spdy { namespace spdy {
...@@ -16,22 +17,17 @@ namespace test { ...@@ -16,22 +17,17 @@ namespace test {
::testing::AssertionResult VerifySpdyFrameWithHeaderBlockIREquals( ::testing::AssertionResult VerifySpdyFrameWithHeaderBlockIREquals(
const SpdyFrameWithHeaderBlockIR& expected, const SpdyFrameWithHeaderBlockIR& expected,
const SpdyFrameWithHeaderBlockIR& actual) { const SpdyFrameWithHeaderBlockIR& actual) {
DVLOG(1) << "VerifySpdyFrameWithHeaderBlockIREquals"; VLOG(1) << "VerifySpdyFrameWithHeaderBlockIREquals";
if (actual.header_block() != expected.header_block()) VERIFY_TRUE(actual.header_block() == expected.header_block());
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyAltSvcIR& expected, ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyAltSvcIR& expected,
const SpdyAltSvcIR& actual) { const SpdyAltSvcIR& actual) {
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.origin(), actual.origin());
if (expected.origin() != actual.origin()) VERIFY_THAT(actual.altsvc_vector(),
return ::testing::AssertionFailure(); ::testing::ContainerEq(expected.altsvc_vector()));
if (actual.altsvc_vector() != expected.altsvc_vector())
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
...@@ -44,133 +40,103 @@ namespace test { ...@@ -44,133 +40,103 @@ namespace test {
::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyDataIR& expected, ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyDataIR& expected,
const SpdyDataIR& actual) { const SpdyDataIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyDataIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyDataIR";
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.fin(), actual.fin());
if (expected.fin() != actual.fin()) VERIFY_EQ(expected.data_len(), actual.data_len());
return ::testing::AssertionFailure(); if (expected.data() == nullptr) {
if (expected.data_len() != actual.data_len()) VERIFY_EQ(nullptr, actual.data());
return ::testing::AssertionFailure(); } else {
if (expected.data() == nullptr && actual.data() != nullptr) VERIFY_EQ(SpdyStringPiece(expected.data(), expected.data_len()),
return ::testing::AssertionFailure(); SpdyStringPiece(actual.data(), actual.data_len()));
if (SpdyStringPiece(expected.data(), expected.data_len()) != }
SpdyStringPiece(actual.data(), actual.data_len())) VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
return ::testing::AssertionFailure();
if (!VerifySpdyFrameWithPaddingIREquals(expected, actual))
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyGoAwayIR& expected, ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyGoAwayIR& expected,
const SpdyGoAwayIR& actual) { const SpdyGoAwayIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyGoAwayIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyGoAwayIR";
if (expected.last_good_stream_id() != actual.last_good_stream_id()) VERIFY_EQ(expected.last_good_stream_id(), actual.last_good_stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.error_code(), actual.error_code());
if (expected.error_code() != actual.error_code()) VERIFY_EQ(expected.description(), actual.description());
return ::testing::AssertionFailure();
if (expected.description() != actual.description())
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals( ::testing::AssertionResult VerifySpdyFrameIREquals(
const SpdyHeadersIR& expected, const SpdyHeadersIR& expected,
const SpdyHeadersIR& actual) { const SpdyHeadersIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyHeadersIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyHeadersIR";
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.fin(), actual.fin());
if (expected.fin() != actual.fin()) VERIFY_SUCCESS(VerifySpdyFrameWithHeaderBlockIREquals(expected, actual));
return ::testing::AssertionFailure(); VERIFY_EQ(expected.has_priority(), actual.has_priority());
if (!VerifySpdyFrameWithHeaderBlockIREquals(expected, actual))
return ::testing::AssertionFailure();
if (expected.has_priority() != actual.has_priority())
return ::testing::AssertionFailure();
if (expected.has_priority()) { if (expected.has_priority()) {
if (!VerifySpdyFrameWithPriorityIREquals(expected, actual)) VERIFY_SUCCESS(VerifySpdyFrameWithPriorityIREquals(expected, actual));
return ::testing::AssertionFailure();
} }
if (!VerifySpdyFrameWithPaddingIREquals(expected, actual)) VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyPingIR& expected, ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyPingIR& expected,
const SpdyPingIR& actual) { const SpdyPingIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyPingIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyPingIR";
if (expected.id() != actual.id()) VERIFY_EQ(expected.id(), actual.id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.is_ack(), actual.is_ack());
if (expected.is_ack() != actual.is_ack())
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals( ::testing::AssertionResult VerifySpdyFrameIREquals(
const SpdyPriorityIR& expected, const SpdyPriorityIR& expected,
const SpdyPriorityIR& actual) { const SpdyPriorityIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyPriorityIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyPriorityIR";
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_SUCCESS(VerifySpdyFrameWithPriorityIREquals(expected, actual));
if (!VerifySpdyFrameWithPriorityIREquals(expected, actual))
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals( ::testing::AssertionResult VerifySpdyFrameIREquals(
const SpdyPushPromiseIR& expected, const SpdyPushPromiseIR& expected,
const SpdyPushPromiseIR& actual) { const SpdyPushPromiseIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyPushPromiseIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyPushPromiseIR";
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
if (!VerifySpdyFrameWithPaddingIREquals(expected, actual)) VERIFY_EQ(expected.promised_stream_id(), actual.promised_stream_id());
return ::testing::AssertionFailure(); VERIFY_SUCCESS(VerifySpdyFrameWithHeaderBlockIREquals(expected, actual));
if (expected.promised_stream_id() != actual.promised_stream_id())
return ::testing::AssertionFailure();
if (!VerifySpdyFrameWithHeaderBlockIREquals(expected, actual))
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals( ::testing::AssertionResult VerifySpdyFrameIREquals(
const SpdyRstStreamIR& expected, const SpdyRstStreamIR& expected,
const SpdyRstStreamIR& actual) { const SpdyRstStreamIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyRstStreamIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyRstStreamIR";
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.error_code(), actual.error_code());
if (expected.error_code() != actual.error_code())
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
::testing::AssertionResult VerifySpdyFrameIREquals( ::testing::AssertionResult VerifySpdyFrameIREquals(
const SpdySettingsIR& expected, const SpdySettingsIR& expected,
const SpdySettingsIR& actual) { const SpdySettingsIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdySettingsIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdySettingsIR";
// Note, ignoring non-HTTP/2 fields such as clear_settings. // Note, ignoring non-HTTP/2 fields such as clear_settings.
if (expected.is_ack() != actual.is_ack()) VERIFY_EQ(expected.is_ack(), actual.is_ack());
return ::testing::AssertionFailure();
// Note, the following doesn't work because there isn't a comparator and
// formatter for SpdySettingsIR::Value. Fixable if we cared.
//
// VERIFY_THAT(actual.values(), ::testing::ContainerEq(actual.values()));
if (expected.values().size() != actual.values().size()) VERIFY_EQ(expected.values().size(), actual.values().size());
return ::testing::AssertionFailure();
for (const auto& entry : expected.values()) { for (const auto& entry : expected.values()) {
const auto& param = entry.first; const auto& param = entry.first;
auto actual_itr = actual.values().find(param); auto actual_itr = actual.values().find(param);
if (actual_itr == actual.values().end()) { VERIFY_TRUE(!(actual_itr == actual.values().end()))
DVLOG(1) << "actual doesn't contain param: " << param; << "actual doesn't contain param: " << param;
return ::testing::AssertionFailure();
}
uint32_t expected_value = entry.second; uint32_t expected_value = entry.second;
uint32_t actual_value = actual_itr->second; uint32_t actual_value = actual_itr->second;
if (expected_value != actual_value) { VERIFY_EQ(expected_value, actual_value)
DVLOG(1) << "Values don't match for parameter: " << param; << "Values don't match for parameter: " << param;
return ::testing::AssertionFailure();
}
} }
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
...@@ -179,12 +145,9 @@ namespace test { ...@@ -179,12 +145,9 @@ namespace test {
::testing::AssertionResult VerifySpdyFrameIREquals( ::testing::AssertionResult VerifySpdyFrameIREquals(
const SpdyWindowUpdateIR& expected, const SpdyWindowUpdateIR& expected,
const SpdyWindowUpdateIR& actual) { const SpdyWindowUpdateIR& actual) {
DVLOG(1) << "VerifySpdyFrameIREquals SpdyWindowUpdateIR"; VLOG(1) << "VerifySpdyFrameIREquals SpdyWindowUpdateIR";
if (expected.stream_id() != actual.stream_id()) VERIFY_EQ(expected.stream_id(), actual.stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.delta(), actual.delta());
if (expected.delta() != actual.delta())
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "net/third_party/spdy/core/spdy_protocol.h" #include "net/third_party/spdy/core/spdy_protocol.h"
#include "net/third_party/spdy/core/spdy_test_utils.h" #include "net/third_party/spdy/core/spdy_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace spdy { namespace spdy {
namespace test { namespace test {
...@@ -37,12 +38,10 @@ namespace test { ...@@ -37,12 +38,10 @@ namespace test {
template <class T> template <class T>
::testing::AssertionResult VerifySpdyFrameWithPaddingIREquals(const T& expected, ::testing::AssertionResult VerifySpdyFrameWithPaddingIREquals(const T& expected,
const T& actual) { const T& actual) {
DVLOG(1) << "VerifySpdyFrameWithPaddingIREquals"; VLOG(1) << "VerifySpdyFrameWithPaddingIREquals";
if (expected.padded() != actual.padded()) VERIFY_EQ(expected.padded(), actual.padded());
return ::testing::AssertionFailure();
if (expected.padded()) { if (expected.padded()) {
if (expected.padding_payload_len() != actual.padding_payload_len()) VERIFY_EQ(expected.padding_payload_len(), actual.padding_payload_len());
return ::testing::AssertionFailure();
} }
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
...@@ -53,14 +52,10 @@ template <class T> ...@@ -53,14 +52,10 @@ template <class T>
::testing::AssertionResult VerifySpdyFrameWithPriorityIREquals( ::testing::AssertionResult VerifySpdyFrameWithPriorityIREquals(
const T& expected, const T& expected,
const T& actual) { const T& actual) {
DVLOG(1) << "VerifySpdyFrameWithPriorityIREquals"; VLOG(1) << "VerifySpdyFrameWithPriorityIREquals";
if (expected.parent_stream_id() != actual.parent_stream_id()) VERIFY_EQ(expected.parent_stream_id(), actual.parent_stream_id());
return ::testing::AssertionFailure(); VERIFY_EQ(expected.weight(), actual.weight());
if (expected.weight() != actual.weight()) VERIFY_EQ(expected.exclusive(), actual.exclusive());
return ::testing::AssertionFailure();
if (expected.exclusive() != actual.exclusive())
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
...@@ -128,19 +123,14 @@ template <class E> ...@@ -128,19 +123,14 @@ template <class E>
::testing::AssertionResult VerifySpdyFrameIREquals(const E* expected, ::testing::AssertionResult VerifySpdyFrameIREquals(const E* expected,
const SpdyFrameIR* actual) { const SpdyFrameIR* actual) {
if (expected == nullptr || actual == nullptr) { if (expected == nullptr || actual == nullptr) {
DVLOG(1) << "VerifySpdyFrameIREquals one null"; VLOG(1) << "VerifySpdyFrameIREquals one null";
if (expected != nullptr) VERIFY_EQ(expected, nullptr);
return ::testing::AssertionFailure(); VERIFY_EQ(actual, nullptr);
if (actual != nullptr)
return ::testing::AssertionFailure();
return ::testing::AssertionSuccess(); return ::testing::AssertionSuccess();
} }
DVLOG(1) << "VerifySpdyFrameIREquals not null"; VLOG(1) << "VerifySpdyFrameIREquals not null";
const E* actual2 = reinterpret_cast<const E*>(actual); VERIFY_EQ(actual->frame_type(), expected->frame_type());
if (actual2 == nullptr) const E* actual2 = static_cast<const E*>(actual);
return ::testing::AssertionFailure();
return VerifySpdyFrameIREquals(*expected, *actual2); return VerifySpdyFrameIREquals(*expected, *actual2);
} }
...@@ -149,7 +139,7 @@ template <class E> ...@@ -149,7 +139,7 @@ template <class E>
template <class E> template <class E>
::testing::AssertionResult VerifySpdyFrameIREquals(const E& expected, ::testing::AssertionResult VerifySpdyFrameIREquals(const E& expected,
const SpdyFrameIR* actual) { const SpdyFrameIR* actual) {
DVLOG(1) << "VerifySpdyFrameIREquals"; VLOG(1) << "VerifySpdyFrameIREquals";
return VerifySpdyFrameIREquals(&expected, actual); return VerifySpdyFrameIREquals(&expected, actual);
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <memory> #include <memory>
#include "net/test/gtest_util.h" #include "net/test/gtest_util.h"
#include "net/third_party/http2/tools/failure.h"
#include "net/third_party/spdy/core/spdy_bug_tracker.h" #include "net/third_party/spdy/core/spdy_bug_tracker.h"
#include "net/third_party/spdy/core/spdy_header_block.h" #include "net/third_party/spdy/core/spdy_header_block.h"
#include "net/third_party/spdy/core/spdy_headers_handler_interface.h" #include "net/third_party/spdy/core/spdy_headers_handler_interface.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment