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

Side by Side Diff: ios/chrome/browser/net/retryable_url_fetcher_unittest.mm

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? 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 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 #import "ios/chrome/browser/net/retryable_url_fetcher.h" 5 #import "ios/chrome/browser/net/retryable_url_fetcher.h"
6 6
7 #import "base/mac/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #include "ios/web/public/test/test_web_thread.h" 8 #include "ios/web/public/test/test_web_thread.h"
9 #include "net/url_request/test_url_fetcher_factory.h" 9 #include "net/url_request/test_url_fetcher_factory.h"
10 #include "net/url_request/url_fetcher_delegate.h" 10 #include "net/url_request/url_fetcher_delegate.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class RetryableURLFetcherTest : public PlatformTest { 46 class RetryableURLFetcherTest : public PlatformTest {
47 protected: 47 protected:
48 void SetUp() override { 48 void SetUp() override {
49 PlatformTest::SetUp(); 49 PlatformTest::SetUp();
50 test_delegate_.reset([[TestRetryableURLFetcherDelegate alloc] init]); 50 test_delegate_.reset([[TestRetryableURLFetcherDelegate alloc] init]);
51 io_thread_.reset( 51 io_thread_.reset(
52 new web::TestWebThread(web::WebThread::IO, &message_loop_)); 52 new web::TestWebThread(web::WebThread::IO, &message_loop_));
53 } 53 }
54 54
55 net::TestURLFetcherFactory factory_; 55 net::TestURLFetcherFactory factory_;
56 scoped_ptr<web::TestWebThread> io_thread_; 56 std::unique_ptr<web::TestWebThread> io_thread_;
57 base::MessageLoop message_loop_; 57 base::MessageLoop message_loop_;
58 base::scoped_nsobject<TestRetryableURLFetcherDelegate> test_delegate_; 58 base::scoped_nsobject<TestRetryableURLFetcherDelegate> test_delegate_;
59 }; 59 };
60 60
61 TEST_F(RetryableURLFetcherTest, TestResponse200) { 61 TEST_F(RetryableURLFetcherTest, TestResponse200) {
62 scoped_refptr<net::URLRequestContextGetter> request_context_getter = 62 scoped_refptr<net::URLRequestContextGetter> request_context_getter =
63 new net::TestURLRequestContextGetter(message_loop_.task_runner()); 63 new net::TestURLRequestContextGetter(message_loop_.task_runner());
64 base::scoped_nsobject<RetryableURLFetcher> retryableFetcher( 64 base::scoped_nsobject<RetryableURLFetcher> retryableFetcher(
65 [[RetryableURLFetcher alloc] 65 [[RetryableURLFetcher alloc]
66 initWithRequestContextGetter:request_context_getter.get() 66 initWithRequestContextGetter:request_context_getter.get()
(...skipping 27 matching lines...) Expand all
94 DCHECK(fetcher); 94 DCHECK(fetcher);
95 DCHECK(fetcher->delegate()); 95 DCHECK(fetcher->delegate());
96 [test_delegate_ setResponsesProcessed:0U]; 96 [test_delegate_ setResponsesProcessed:0U];
97 fetcher->set_response_code(404); 97 fetcher->set_response_code(404);
98 fetcher->SetResponseString(""); 98 fetcher->SetResponseString("");
99 fetcher->delegate()->OnURLFetchComplete(fetcher); 99 fetcher->delegate()->OnURLFetchComplete(fetcher);
100 EXPECT_EQ(0U, [test_delegate_ responsesProcessed]); 100 EXPECT_EQ(0U, [test_delegate_ responsesProcessed]);
101 } 101 }
102 102
103 } // namespace 103 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698