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

Side by Side Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher_service_unittest.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" 5 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class TestService : public BitmapFetcherService { 42 class TestService : public BitmapFetcherService {
43 public: 43 public:
44 explicit TestService(content::BrowserContext* context) 44 explicit TestService(content::BrowserContext* context)
45 : BitmapFetcherService(context) {} 45 : BitmapFetcherService(context) {}
46 ~TestService() override {} 46 ~TestService() override {}
47 47
48 // Create a fetcher, but don't start downloading. That allows side-stepping 48 // Create a fetcher, but don't start downloading. That allows side-stepping
49 // the decode step, which requires a utility process. 49 // the decode step, which requires a utility process.
50 std::unique_ptr<chrome::BitmapFetcher> CreateFetcher( 50 std::unique_ptr<chrome::BitmapFetcher> CreateFetcher(
51 const GURL& url) override { 51 const GURL& url) override {
52 return base::WrapUnique(new chrome::BitmapFetcher(url, this)); 52 return base::MakeUnique<chrome::BitmapFetcher>(url, this);
53 } 53 }
54 }; 54 };
55 55
56 } // namespace 56 } // namespace
57 57
58 class BitmapFetcherServiceTest : public testing::Test, 58 class BitmapFetcherServiceTest : public testing::Test,
59 public TestNotificationInterface { 59 public TestNotificationInterface {
60 public: 60 public:
61 BitmapFetcherServiceTest() 61 BitmapFetcherServiceTest()
62 : url1_(GURL("http://example.org/sample-image-1.png")), 62 : url1_(GURL("http://example.org/sample-image-1.png")),
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 service_->RequestImage(url1_, new TestObserver(this)); 195 service_->RequestImage(url1_, new TestObserver(this));
196 service_->RequestImage(url2_, new TestObserver(this)); 196 service_->RequestImage(url2_, new TestObserver(this));
197 EXPECT_EQ(0U, cache_size()); 197 EXPECT_EQ(0U, cache_size());
198 198
199 CompleteFetch(url1_); 199 CompleteFetch(url1_);
200 EXPECT_EQ(1U, cache_size()); 200 EXPECT_EQ(1U, cache_size());
201 201
202 FailFetch(url2_); 202 FailFetch(url2_);
203 EXPECT_EQ(1U, cache_size()); 203 EXPECT_EQ(1U, cache_size());
204 } 204 }
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_settings_helper.cc ('k') | chrome/browser/bookmarks/bookmark_model_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698