Index: net/spdy/hpack_huffman_aggregator_test.cc |
diff --git a/net/spdy/hpack_huffman_aggregator_test.cc b/net/spdy/hpack_huffman_aggregator_test.cc |
index 23a9a43edb762e21553c8a99ed70c66645d723e1..7cb9fdf01c980bb04aa1994ad197ae6b406a500e 100644 |
--- a/net/spdy/hpack_huffman_aggregator_test.cc |
+++ b/net/spdy/hpack_huffman_aggregator_test.cc |
@@ -30,15 +30,11 @@ class HpackHuffmanAggregatorPeer { |
explicit HpackHuffmanAggregatorPeer(HpackHuffmanAggregator* agg) |
: agg_(agg) {} |
- std::vector<size_t>* counts() { |
- return &agg_->counts_; |
- } |
+ std::vector<size_t>* counts() { return &agg_->counts_; } |
HpackHuffmanAggregator::OriginEncoders* encoders() { |
return &agg_->encoders_; |
} |
- size_t total_counts() { |
- return agg_->total_counts_; |
- } |
+ size_t total_counts() { return agg_->total_counts_; } |
void set_total_counts(size_t total_counts) { |
agg_->total_counts_ = total_counts; |
} |
@@ -51,15 +47,13 @@ class HpackHuffmanAggregatorPeer { |
static void CreateSpdyHeadersFromHttpResponse( |
const HttpResponseHeaders& headers, |
SpdyHeaderBlock* headers_out) { |
- HpackHuffmanAggregator::CreateSpdyHeadersFromHttpResponse( |
- headers, headers_out); |
+ HpackHuffmanAggregator::CreateSpdyHeadersFromHttpResponse(headers, |
+ headers_out); |
} |
HpackEncoder* ObtainEncoder(const SpdySessionKey& key) { |
return agg_->ObtainEncoder(key); |
} |
- void PublishCounts() { |
- agg_->PublishCounts(); |
- } |
+ void PublishCounts() { agg_->PublishCounts(); } |
private: |
HpackHuffmanAggregator* agg_; |
@@ -69,8 +63,7 @@ class HpackHuffmanAggregatorPeer { |
class HpackHuffmanAggregatorTest : public ::testing::Test { |
protected: |
- HpackHuffmanAggregatorTest() |
- : peer_(&agg_) {} |
+ HpackHuffmanAggregatorTest() : peer_(&agg_) {} |
HpackHuffmanAggregator agg_; |
test::HpackHuffmanAggregatorPeer peer_; |
@@ -112,11 +105,14 @@ TEST_F(HpackHuffmanAggregatorTest, CrossOriginDetermination) { |
TEST_F(HpackHuffmanAggregatorTest, EncoderLRUQueue) { |
peer_.set_max_encoders(2); |
- SpdySessionKey key1(HostPortPair("one.com", 443), ProxyServer::Direct(), |
+ SpdySessionKey key1(HostPortPair("one.com", 443), |
+ ProxyServer::Direct(), |
PRIVACY_MODE_ENABLED); |
- SpdySessionKey key2(HostPortPair("two.com", 443), ProxyServer::Direct(), |
+ SpdySessionKey key2(HostPortPair("two.com", 443), |
+ ProxyServer::Direct(), |
PRIVACY_MODE_ENABLED); |
- SpdySessionKey key3(HostPortPair("three.com", 443), ProxyServer::Direct(), |
+ SpdySessionKey key3(HostPortPair("three.com", 443), |
+ ProxyServer::Direct(), |
PRIVACY_MODE_ENABLED); |
// Creates one.com. |
@@ -153,7 +149,7 @@ TEST_F(HpackHuffmanAggregatorTest, PublishCounts) { |
// Verify histogram counts match the expectation. |
scoped_ptr<base::HistogramSamples> samples = |
base::StatisticsRecorder::FindHistogram(kHistogramName) |
- ->SnapshotSamples(); |
+ ->SnapshotSamples(); |
EXPECT_EQ(0, samples->GetCount(0)); |
EXPECT_EQ(1, samples->GetCount(1)); |
@@ -170,7 +166,7 @@ TEST_F(HpackHuffmanAggregatorTest, PublishCounts) { |
// Verify they've been aggregated into the previous counts. |
samples = base::StatisticsRecorder::FindHistogram(kHistogramName) |
- ->SnapshotSamples(); |
+ ->SnapshotSamples(); |
EXPECT_EQ(0, samples->GetCount(0)); |
EXPECT_EQ(1, samples->GetCount(1)); |
@@ -182,23 +178,25 @@ TEST_F(HpackHuffmanAggregatorTest, PublishCounts) { |
TEST_F(HpackHuffmanAggregatorTest, CreateSpdyResponseHeaders) { |
char kRawHeaders[] = |
- "HTTP/1.1 202 Accepted \0" |
- "Content-TYPE : text/html; charset=utf-8 \0" |
- "Set-Cookie: foo=bar \0" |
- "Set-Cookie: baz=bing \0" |
- "Cache-Control: pragma=no-cache \0" |
- "Cache-CONTROL: expires=12345 \0\0"; |
+ "HTTP/1.1 202 Accepted \0" |
+ "Content-TYPE : text/html; charset=utf-8 \0" |
+ "Set-Cookie: foo=bar \0" |
+ "Set-Cookie: baz=bing \0" |
+ "Cache-Control: pragma=no-cache \0" |
+ "Cache-CONTROL: expires=12345 \0\0"; |
scoped_refptr<HttpResponseHeaders> parsed_headers(new HttpResponseHeaders( |
std::string(kRawHeaders, arraysize(kRawHeaders) - 1))); |
SpdyHeaderBlock headers; |
peer_.CreateSpdyHeadersFromHttpResponse(*parsed_headers, &headers); |
- EXPECT_THAT(headers, ElementsAre( |
- Pair(":status", "202"), |
- Pair("cache-control", std::string("pragma=no-cache\0expires=12345", 29)), |
- Pair("content-type", "text/html; charset=utf-8"), |
- Pair("set-cookie", std::string("foo=bar\0baz=bing", 16)))); |
+ EXPECT_THAT( |
+ headers, |
+ ElementsAre(Pair(":status", "202"), |
+ Pair("cache-control", |
+ std::string("pragma=no-cache\0expires=12345", 29)), |
+ Pair("content-type", "text/html; charset=utf-8"), |
+ Pair("set-cookie", std::string("foo=bar\0baz=bing", 16)))); |
} |
} // namespace net |