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

Unified Diff: chrome/browser/android/offline_pages/prerender_adapter_unittest.cc

Issue 2419913002: Fix some WebContents leaks in prerendering tests (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | chrome/browser/android/offline_pages/prerendering_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/prerender_adapter_unittest.cc
diff --git a/chrome/browser/android/offline_pages/prerender_adapter_unittest.cc b/chrome/browser/android/offline_pages/prerender_adapter_unittest.cc
index 3c36eb060d6283c1cfcaadf35d78c1a021a18e8c..d17d256cd4f3ee14d4e42e408122e7db80e49215 100644
--- a/chrome/browser/android/offline_pages/prerender_adapter_unittest.cc
+++ b/chrome/browser/android/offline_pages/prerender_adapter_unittest.cc
@@ -201,8 +201,9 @@ TEST_F(PrerenderAdapterTest, StartPrerenderFailsForUnsupportedScheme) {
if (base::SysInfo::IsLowEndDevice())
return;
- content::WebContents* session_contents = content::WebContents::Create(
- content::WebContents::CreateParams(profile()));
+ std::unique_ptr<content::WebContents> session_contents(
+ content::WebContents::Create(
+ content::WebContents::CreateParams(profile())));
content::SessionStorageNamespace* sessionStorageNamespace =
session_contents->GetController().GetDefaultSessionStorageNamespace();
gfx::Size renderWindowSize = session_contents->GetContainerBounds().size();
@@ -218,8 +219,9 @@ TEST_F(PrerenderAdapterTest, StartPrerenderSucceeds) {
if (base::SysInfo::IsLowEndDevice())
return;
- content::WebContents* session_contents = content::WebContents::Create(
- content::WebContents::CreateParams(profile()));
+ std::unique_ptr<content::WebContents> session_contents(
+ content::WebContents::Create(
+ content::WebContents::CreateParams(profile())));
content::SessionStorageNamespace* sessionStorageNamespace =
session_contents->GetController().GetDefaultSessionStorageNamespace();
gfx::Size renderWindowSize = session_contents->GetContainerBounds().size();
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/prerendering_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698