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

Unified Diff: components/dom_distiller/content/distiller_page_web_contents_browsertest.cc

Issue 1058193002: Add support for not owning distilled WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues. Created 5 years, 7 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/content/distiller_page_web_contents.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
diff --git a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
index 93978e214208a699d9a97c4dbb47a39bf7a5c15b..5244a194f3eb7a28d0069b08424cef793d5b0a02 100644
--- a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
+++ b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
@@ -161,22 +161,9 @@ class TestDistillerPageWebContents : public DistillerPageWebContents {
void CreateNewWebContents(const GURL& url) override {
ASSERT_EQ(true, expect_new_web_contents_);
new_web_contents_created_ = true;
- // DistillerPageWebContents::CreateNewWebContents resets the scoped_ptr to
- // the WebContents, so intentionally leak WebContents here, since it is
- // owned by the shell.
- content::WebContents* web_contents = web_contents_.release();
- web_contents->GetLastCommittedURL();
DistillerPageWebContents::CreateNewWebContents(url);
}
- ~TestDistillerPageWebContents() override {
- if (!expect_new_web_contents_) {
- // Intentionally leaking WebContents, since it is owned by the shell.
- content::WebContents* web_contents = web_contents_.release();
- web_contents->GetLastCommittedURL();
- }
- }
-
bool new_web_contents_created() { return new_web_contents_created_; }
private:
@@ -360,9 +347,8 @@ void DistillerPageWebContentsTest::RunUseCurrentWebContentsTest(
std::string());
url_loaded_runner.Run();
- scoped_ptr<content::WebContents> old_web_contents_sptr(current_web_contents);
scoped_ptr<SourcePageHandleWebContents> source_page_handle(
- new SourcePageHandleWebContents(old_web_contents_sptr.Pass()));
+ new SourcePageHandleWebContents(current_web_contents, false));
TestDistillerPageWebContents distiller_page(
shell()->web_contents()->GetBrowserContext(),
« no previous file with comments | « components/dom_distiller/content/distiller_page_web_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698