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

Side by Side Diff: net/tools/balsa/balsa_frame_test.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/tools/balsa/balsa_frame.h" 5 #include "net/tools/balsa/balsa_frame.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <memory>
8 9
9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
11 #include "net/tools/balsa/balsa_enums.h" 11 #include "net/tools/balsa/balsa_enums.h"
12 #include "net/tools/balsa/balsa_headers.h" 12 #include "net/tools/balsa/balsa_headers.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 namespace { 18 namespace {
19 19
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class BalsaFrameTest : public ::testing::Test { 59 class BalsaFrameTest : public ::testing::Test {
60 public: 60 public:
61 void SetUp() override { 61 void SetUp() override {
62 frame_.reset(new BalsaFrame); 62 frame_.reset(new BalsaFrame);
63 frame_headers_.reset(new BalsaHeaders); 63 frame_headers_.reset(new BalsaHeaders);
64 visitor_.reset(new Visitor); 64 visitor_.reset(new Visitor);
65 frame_->set_balsa_visitor(visitor_.get()); 65 frame_->set_balsa_visitor(visitor_.get());
66 }; 66 };
67 67
68 protected: 68 protected:
69 scoped_ptr<BalsaFrame> frame_; 69 std::unique_ptr<BalsaFrame> frame_;
70 scoped_ptr<BalsaHeaders> frame_headers_; 70 std::unique_ptr<BalsaHeaders> frame_headers_;
71 scoped_ptr<Visitor> visitor_; 71 std::unique_ptr<Visitor> visitor_;
72 }; 72 };
73 73
74 TEST_F(BalsaFrameTest, EmptyFrame) { 74 TEST_F(BalsaFrameTest, EmptyFrame) {
75 ASSERT_EQ(BalsaFrameEnums::READING_HEADER_AND_FIRSTLINE, 75 ASSERT_EQ(BalsaFrameEnums::READING_HEADER_AND_FIRSTLINE,
76 frame_->ParseState()); 76 frame_->ParseState());
77 ASSERT_FALSE(frame_->MessageFullyRead()); 77 ASSERT_FALSE(frame_->MessageFullyRead());
78 ASSERT_FALSE(frame_->Error()); 78 ASSERT_FALSE(frame_->Error());
79 ASSERT_EQ(NULL, frame_->const_balsa_headers()); 79 ASSERT_EQ(NULL, frame_->const_balsa_headers());
80 ASSERT_EQ(NULL, frame_->balsa_headers()); 80 ASSERT_EQ(NULL, frame_->balsa_headers());
81 ASSERT_EQ(NULL, frame_->headers()); 81 ASSERT_EQ(NULL, frame_->headers());
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 ASSERT_TRUE(frame_->Error()); 590 ASSERT_TRUE(frame_->Error());
591 ASSERT_EQ( 591 ASSERT_EQ(
592 BalsaFrameEnums::CALLED_BYTES_SPLICED_AND_EXCEEDED_SAFE_SPLICE_AMOUNT, 592 BalsaFrameEnums::CALLED_BYTES_SPLICED_AND_EXCEEDED_SAFE_SPLICE_AMOUNT,
593 frame_->ErrorCode()); 593 frame_->ErrorCode());
594 ASSERT_EQ(0u, frame_->BytesSafeToSplice()); 594 ASSERT_EQ(0u, frame_->BytesSafeToSplice());
595 } 595 }
596 596
597 } // namespace 597 } // namespace
598 598
599 } // namespace net 599 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_slow_download_job.cc ('k') | net/tools/balsa/balsa_headers_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698