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

Unified Diff: chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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
Index: chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
diff --git a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
index 7bdf935eb572f75dc13973dc437d59ec2b5ae8e8..942eddb0cc895b689a9dfb56b73967cb95d590a9 100644
--- a/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
+++ b/chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/guid.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -93,22 +94,19 @@ class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest {
command_line->AppendSwitch(switches::kEnableDomDistiller);
}
- static KeyedService* Build(content::BrowserContext* context) {
+ static scoped_ptr<KeyedService> Build(content::BrowserContext* context) {
FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_);
distiller_factory_ = new MockDistillerFactory();
MockDistillerPageFactory* distiller_page_factory_ =
new MockDistillerPageFactory();
- DomDistillerContextKeyedService* service =
+ scoped_ptr<DomDistillerContextKeyedService> service(
new DomDistillerContextKeyedService(
- scoped_ptr<DomDistillerStoreInterface>(
- CreateStoreWithFakeDB(fake_db,
- FakeDB<ArticleEntry>::EntryMap())),
+ scoped_ptr<DomDistillerStoreInterface>(CreateStoreWithFakeDB(
+ fake_db, FakeDB<ArticleEntry>::EntryMap())),
scoped_ptr<DistillerFactory>(distiller_factory_),
scoped_ptr<DistillerPageFactory>(distiller_page_factory_),
- scoped_ptr<DistilledPagePrefs>(
- new DistilledPagePrefs(
- Profile::FromBrowserContext(
- context)->GetPrefs())));
+ scoped_ptr<DistilledPagePrefs>(new DistilledPagePrefs(
+ Profile::FromBrowserContext(context)->GetPrefs()))));
fake_db->InitCallback(true);
fake_db->LoadCallback(true);
if (expect_distillation_) {
@@ -123,7 +121,7 @@ class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest {
EXPECT_CALL(*distiller_page_factory_, CreateDistillerPageImpl())
.WillOnce(testing::Return(distiller_page));
}
- return service;
+ return service.Pass();
}
void ViewSingleDistilledPage(const GURL& url,

Powered by Google App Engine
This is Rietveld 408576698