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

Unified Diff: net/quic/quic_headers_stream_test.cc

Issue 1410243007: Add a new method to QuicSpdySession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106714904
Patch Set: Created 5 years, 1 month 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/quic/quic_headers_stream.cc ('k') | net/quic/quic_spdy_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_headers_stream_test.cc
diff --git a/net/quic/quic_headers_stream_test.cc b/net/quic/quic_headers_stream_test.cc
index 4fa3c1f8f607e89797e84cf90097c820436e2f30..a21f191f45ea1fa0515e8af9ae9d7029ff4460fe 100644
--- a/net/quic/quic_headers_stream_test.cc
+++ b/net/quic/quic_headers_stream_test.cc
@@ -4,7 +4,6 @@
#include "net/quic/quic_headers_stream.h"
-#include "base/test/histogram_tester.h"
#include "net/quic/quic_utils.h"
#include "net/quic/spdy_utils.h"
#include "net/quic/test_tools/quic_connection_peer.h"
@@ -15,8 +14,6 @@
#include "net/spdy/spdy_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
-using base::Bucket;
-using base::HistogramTester;
using base::StringPiece;
using std::ostream;
using std::string;
@@ -303,17 +300,8 @@ TEST_P(QuicHeadersStreamTest, ProcessRawData) {
}
TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) {
-// In the absence of surfacing HOL measurements externally, via UMA
-// or tcp connection stats, log messages are the only indication.
-// This test verifies that false positives are not generated when
-// headers arrive in order.
-#if 0
- ScopedMockLog log(kDoNotCaptureLogsYet);
- EXPECT_CALL(log, Log(_, _, _)).Times(0);
- log.StartCapturingLogs();
-#endif
- InSequence seq;
- HistogramTester histogram_tester;
+ EXPECT_CALL(session_, OnHeadersHeadOfLineBlocking(_)).Times(0);
+ testing::InSequence seq;
bool fin = true;
for (int stream_num = 0; stream_num < 10; stream_num++) {
QuicStreamId stream_id = QuicClientDataStreamId(stream_num);
@@ -340,18 +328,9 @@ TEST_P(QuicHeadersStreamTest, EmptyHeaderHOLBlockedTime) {
connection_->AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
stream_frame_.offset += frame->size();
}
- histogram_tester.ExpectTotalCount("Net.QuicSession.HeadersHOLBlockedTime", 0);
}
TEST_P(QuicHeadersStreamTest, NonEmptyHeaderHOLBlockedTime) {
-// In the absence of surfacing HOL measurements externally, via UMA
-// or tcp connection stats, log messages are the only indication.
-// This test verifies that HOL blocking log messages are correct
-// when there are out of order arrivals.
-#if 0
- ScopedMockLog log(kDoNotCaptureLogsYet);
-#endif
- HistogramTester histogram_tester;
QuicStreamId stream_id;
bool fin = true;
QuicStreamFrame stream_frames[10];
@@ -385,36 +364,16 @@ TEST_P(QuicHeadersStreamTest, NonEmptyHeaderHOLBlockedTime) {
.Times(1);
}
}
-#if 0
- // Actually writing the frames in reverse order will trigger log messages.
- {
- InSequence seq;
- for (int stream_num = 0; stream_num < 10; ++stream_num) {
- stream_id = QuicClientDataStreamId(stream_num);
- if (stream_num > 0) {
- string expected_msg = StringPrintf(
- "stream %d: Net.QuicSession.HeadersHOLBlockedTime %d",
- stream_id, stream_num);
-#ifndef NDEBUG
- EXPECT_CALL(log, Log(INFO, _, expected_msg));
-#endif
- }
- }
- }
- log.StartCapturingLogs();
-#endif
+
+ // Actually writing the frames in reverse order will cause HOL blocking.
+ EXPECT_CALL(session_, OnHeadersHeadOfLineBlocking(_)).Times(9);
+
for (int stream_num = 9; stream_num >= 0; --stream_num) {
DVLOG(1) << "OnStreamFrame for stream " << stream_num << " offset "
<< stream_frames[stream_num].offset;
headers_stream_->OnStreamFrame(stream_frames[stream_num]);
connection_->AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
}
- // We expect 1 sample each for delays from 1 to 9 ms (8 and 9 go
- // into the same bucket).
- EXPECT_THAT(
- histogram_tester.GetAllSamples("Net.QuicSession.HeadersHOLBlockedTime"),
- ElementsAre(Bucket(1, 1), Bucket(2, 1), Bucket(3, 1), Bucket(4, 1),
- Bucket(5, 1), Bucket(6, 1), Bucket(7, 1), Bucket(8, 2)));
}
TEST_P(QuicHeadersStreamTest, ProcessLargeRawData) {
« no previous file with comments | « net/quic/quic_headers_stream.cc ('k') | net/quic/quic_spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698