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

Unified Diff: components/dom_distiller/core/viewer_unittest.cc

Issue 1879613003: Convert //components/dom_distiller 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | components/dom_distiller/ios/distiller_page_factory_ios.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/viewer_unittest.cc
diff --git a/components/dom_distiller/core/viewer_unittest.cc b/components/dom_distiller/core/viewer_unittest.cc
index 2e7478a047abf9ca0e8f378bb4e08b7f2e126b59..009640f68d20fd681df2ba361e7807a35b3c213e 100644
--- a/components/dom_distiller/core/viewer_unittest.cc
+++ b/components/dom_distiller/core/viewer_unittest.cc
@@ -35,7 +35,7 @@ class TestDomDistillerService : public DomDistillerServiceInterface {
const ArticleAvailableCallback&));
const std::string AddToList(
const GURL& url,
- scoped_ptr<DistillerPage> distiller_page,
+ std::unique_ptr<DistillerPage> distiller_page,
const ArticleAvailableCallback& article_cb) override {
return AddToList(url, distiller_page.get(), article_cb);
}
@@ -45,30 +45,30 @@ class TestDomDistillerService : public DomDistillerServiceInterface {
MOCK_METHOD1(AddObserver, void(DomDistillerObserver*));
MOCK_METHOD1(RemoveObserver, void(DomDistillerObserver*));
MOCK_METHOD0(ViewUrlImpl, ViewerHandle*());
- scoped_ptr<ViewerHandle> ViewUrl(
+ std::unique_ptr<ViewerHandle> ViewUrl(
ViewRequestDelegate*,
- scoped_ptr<DistillerPage> distiller_page,
+ std::unique_ptr<DistillerPage> distiller_page,
const GURL&) override {
- return scoped_ptr<ViewerHandle>(ViewUrlImpl());
+ return std::unique_ptr<ViewerHandle>(ViewUrlImpl());
}
MOCK_METHOD0(ViewEntryImpl, ViewerHandle*());
- scoped_ptr<ViewerHandle> ViewEntry(
+ std::unique_ptr<ViewerHandle> ViewEntry(
ViewRequestDelegate*,
- scoped_ptr<DistillerPage> distiller_page,
+ std::unique_ptr<DistillerPage> distiller_page,
const std::string&) override {
- return scoped_ptr<ViewerHandle>(ViewEntryImpl());
+ return std::unique_ptr<ViewerHandle>(ViewEntryImpl());
}
MOCK_METHOD0(RemoveEntryImpl, ArticleEntry*());
- scoped_ptr<ArticleEntry> RemoveEntry(const std::string&) override {
- return scoped_ptr<ArticleEntry>(RemoveEntryImpl());
+ std::unique_ptr<ArticleEntry> RemoveEntry(const std::string&) override {
+ return std::unique_ptr<ArticleEntry>(RemoveEntryImpl());
}
- scoped_ptr<DistillerPage> CreateDefaultDistillerPage(
+ std::unique_ptr<DistillerPage> CreateDefaultDistillerPage(
const gfx::Size& render_view_size) override {
- return scoped_ptr<DistillerPage>();
+ return std::unique_ptr<DistillerPage>();
}
- scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle(
- scoped_ptr<SourcePageHandle> handle) override {
- return scoped_ptr<DistillerPage>();
+ std::unique_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle(
+ std::unique_ptr<SourcePageHandle> handle) override {
+ return std::unique_ptr<DistillerPage>();
}
DistilledPagePrefs* GetDistilledPagePrefs() override;
};
@@ -78,18 +78,18 @@ class DomDistillerViewerTest : public testing::Test {
void SetUp() override { service_.reset(new TestDomDistillerService()); }
protected:
- scoped_ptr<ViewerHandle> CreateViewRequest(
+ std::unique_ptr<ViewerHandle> CreateViewRequest(
const std::string& path,
ViewRequestDelegate* view_request_delegate) {
return viewer::CreateViewRequest(
service_.get(), path, view_request_delegate, gfx::Size());
}
- scoped_ptr<TestDomDistillerService> service_;
+ std::unique_ptr<TestDomDistillerService> service_;
};
TEST_F(DomDistillerViewerTest, TestCreatingViewUrlRequest) {
- scoped_ptr<FakeViewRequestDelegate> view_request_delegate(
+ std::unique_ptr<FakeViewRequestDelegate> view_request_delegate(
new FakeViewRequestDelegate());
ViewerHandle* viewer_handle(new ViewerHandle(ViewerHandle::CancelCallback()));
EXPECT_CALL(*service_.get(), ViewUrlImpl())
@@ -101,7 +101,7 @@ TEST_F(DomDistillerViewerTest, TestCreatingViewUrlRequest) {
}
TEST_F(DomDistillerViewerTest, TestCreatingViewEntryRequest) {
- scoped_ptr<FakeViewRequestDelegate> view_request_delegate(
+ std::unique_ptr<FakeViewRequestDelegate> view_request_delegate(
new FakeViewRequestDelegate());
ViewerHandle* viewer_handle(new ViewerHandle(ViewerHandle::CancelCallback()));
EXPECT_CALL(*service_.get(), ViewEntryImpl())
@@ -112,7 +112,7 @@ TEST_F(DomDistillerViewerTest, TestCreatingViewEntryRequest) {
}
TEST_F(DomDistillerViewerTest, TestCreatingInvalidViewRequest) {
- scoped_ptr<FakeViewRequestDelegate> view_request_delegate(
+ std::unique_ptr<FakeViewRequestDelegate> view_request_delegate(
new FakeViewRequestDelegate());
EXPECT_CALL(*service_.get(), ViewEntryImpl()).Times(0);
EXPECT_CALL(*service_.get(), ViewUrlImpl()).Times(0);
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | components/dom_distiller/ios/distiller_page_factory_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698