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

Unified Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 12602003: When a pending contents is created but deleted before it is shown, remove it from the list of pendi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 6ec83207a1e3ac031741ceab54d9273b7f688181..d08404ca3ddc65044c1906f5bb7a4b2bb3be5571 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -2037,5 +2037,15 @@ TEST_F(WebContentsImplTest, FilterURLs) {
EXPECT_EQ(url_normalized, other_observer.last_url());
}
+// Test that a if a pending contents is deleted before it is shown, we don't
+// creash.
Charlie Reis 2013/03/07 18:20:00 nit: crash
jochen (gone - plz use gerrit) 2013/03/07 19:45:10 Done.
+TEST_F(WebContentsImplTest, PendingContents) {
+ scoped_ptr<TestWebContents> other_contents(
+ static_cast<TestWebContents*>(CreateTestWebContents()));
+ contents()->AddPendingContents(other_contents.get());
+ int route_id = other_contents->GetRenderViewHost()->GetRoutingID();
+ other_contents.reset();
+ EXPECT_EQ(NULL, contents()->GetCreatedWindow(route_id));
+}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698