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

Side by Side Diff: net/spdy/spdy_pinnable_buffer_piece_test.cc

Issue 266243004: Clang format slam. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_pinnable_buffer_piece.h" 5 #include "net/spdy/spdy_pinnable_buffer_piece.h"
6 6
7 #include "net/spdy/spdy_prefixed_buffer_reader.h" 7 #include "net/spdy/spdy_prefixed_buffer_reader.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace net { 10 namespace net {
11 11
12 namespace test { 12 namespace test {
13 13
14 using base::StringPiece; 14 using base::StringPiece;
15 15
16 class SpdyPinnableBufferPieceTest : public ::testing::Test { 16 class SpdyPinnableBufferPieceTest : public ::testing::Test {
17 protected: 17 protected:
18 SpdyPrefixedBufferReader Build(std::string prefix, std::string suffix) { 18 SpdyPrefixedBufferReader Build(std::string prefix, std::string suffix) {
19 prefix_ = prefix; 19 prefix_ = prefix;
20 suffix_ = suffix; 20 suffix_ = suffix;
21 return SpdyPrefixedBufferReader(prefix_.data(), prefix_.length(), 21 return SpdyPrefixedBufferReader(
22 suffix_.data(), suffix_.length()); 22 prefix_.data(), prefix_.length(), suffix_.data(), suffix_.length());
23 } 23 }
24 std::string prefix_, suffix_; 24 std::string prefix_, suffix_;
25 }; 25 };
26 26
27 TEST_F(SpdyPinnableBufferPieceTest, Pin) { 27 TEST_F(SpdyPinnableBufferPieceTest, Pin) {
28 SpdyPrefixedBufferReader reader = Build("foobar", ""); 28 SpdyPrefixedBufferReader reader = Build("foobar", "");
29 SpdyPinnableBufferPiece piece; 29 SpdyPinnableBufferPiece piece;
30 EXPECT_TRUE(reader.ReadN(6, &piece)); 30 EXPECT_TRUE(reader.ReadN(6, &piece));
31 31
32 // Piece points to underlying prefix storage. 32 // Piece points to underlying prefix storage.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 SpdyPinnableBufferPiece empty; 70 SpdyPinnableBufferPiece empty;
71 piece2.Swap(&empty); 71 piece2.Swap(&empty);
72 72
73 EXPECT_EQ(StringPiece(""), piece2); 73 EXPECT_EQ(StringPiece(""), piece2);
74 EXPECT_FALSE(piece2.IsPinned()); 74 EXPECT_FALSE(piece2.IsPinned());
75 } 75 }
76 76
77 } // namespace test 77 } // namespace test
78 78
79 } // namespace net 79 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698