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

Side by Side Diff: net/spdy/core/spdy_header_indexing_test.cc

Issue 2840563003: Implement SpdyMakeUnique and SpdyWrapUnique. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « net/spdy/core/spdy_header_block.cc ('k') | net/spdy/core/spdy_pinnable_buffer_piece.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/core/spdy_header_indexing.h" 5 #include "net/spdy/core/spdy_header_indexing.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "net/spdy/platform/api/spdy_ptr_util.h"
8 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
10 11
11 namespace net { 12 namespace net {
12 13
13 namespace test { 14 namespace test {
14 15
15 class HeaderIndexingPeer { 16 class HeaderIndexingPeer {
16 public: 17 public:
17 HeaderIndexingPeer() : hi_() {} 18 HeaderIndexingPeer() : hi_() {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 50
50 private: 51 private:
51 HeaderIndexing hi_; 52 HeaderIndexing hi_;
52 }; 53 };
53 54
54 class SpdyHeaderIndexingTest : public ::testing::Test { 55 class SpdyHeaderIndexingTest : public ::testing::Test {
55 protected: 56 protected:
56 SpdyHeaderIndexingTest() { 57 SpdyHeaderIndexingTest() {
57 FLAGS_gfe_spdy_indexing_set_bound = 3; 58 FLAGS_gfe_spdy_indexing_set_bound = 3;
58 FLAGS_gfe_spdy_tracking_set_bound = 4; 59 FLAGS_gfe_spdy_tracking_set_bound = 4;
59 hi_ = base::MakeUnique<HeaderIndexingPeer>(); 60 hi_ = SpdyMakeUnique<HeaderIndexingPeer>();
60 hi_->CreateTestInit(); 61 hi_->CreateTestInit();
61 } 62 }
62 void SetUp() override { 63 void SetUp() override {
63 EXPECT_EQ(3u, hi_->indexing_set_size()); 64 EXPECT_EQ(3u, hi_->indexing_set_size());
64 EXPECT_EQ(3u, hi_->tracking_set_size()); 65 EXPECT_EQ(3u, hi_->tracking_set_size());
65 } 66 }
66 std::unique_ptr<HeaderIndexingPeer> hi_; 67 std::unique_ptr<HeaderIndexingPeer> hi_;
67 }; 68 };
68 69
69 TEST_F(SpdyHeaderIndexingTest, TestTryInsertHeader) { 70 TEST_F(SpdyHeaderIndexingTest, TestTryInsertHeader) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 EXPECT_EQ(100u, hi_->tracking_set_size()); 116 EXPECT_EQ(100u, hi_->tracking_set_size());
116 EXPECT_TRUE(hi_->ShouldIndex(":status")); 117 EXPECT_TRUE(hi_->ShouldIndex(":status"));
117 EXPECT_TRUE(hi_->InTrackingSet(":status")); 118 EXPECT_TRUE(hi_->InTrackingSet(":status"));
118 EXPECT_FALSE(hi_->InTrackingSet("NotValid")); 119 EXPECT_FALSE(hi_->InTrackingSet("NotValid"));
119 EXPECT_FALSE(hi_->ShouldIndex("NotValid")); 120 EXPECT_FALSE(hi_->ShouldIndex("NotValid"));
120 } 121 }
121 122
122 } // namespace test 123 } // namespace test
123 124
124 } // namespace net 125 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/core/spdy_header_block.cc ('k') | net/spdy/core/spdy_pinnable_buffer_piece.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698