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

Side by Side 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: updates 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "content/browser/renderer_host/render_view_host_impl.h" 7 #include "content/browser/renderer_host/render_view_host_impl.h"
8 #include "content/browser/renderer_host/test_render_view_host.h" 8 #include "content/browser/renderer_host/test_render_view_host.h"
9 #include "content/browser/site_instance_impl.h" 9 #include "content/browser/site_instance_impl.h"
10 #include "content/browser/web_contents/interstitial_page_impl.h" 10 #include "content/browser/web_contents/interstitial_page_impl.h"
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 static_cast<TestWebContents*>(CreateTestWebContents())); 2030 static_cast<TestWebContents*>(CreateTestWebContents()));
2031 TestWebContentsObserver other_observer(other_contents.get()); 2031 TestWebContentsObserver other_observer(other_contents.get());
2032 other_contents->NavigateAndCommit(url_normalized); 2032 other_contents->NavigateAndCommit(url_normalized);
2033 2033
2034 // Check that an IPC with about:whatever is correctly normalized. 2034 // Check that an IPC with about:whatever is correctly normalized.
2035 other_contents->TestDidFailLoadWithError( 2035 other_contents->TestDidFailLoadWithError(
2036 1, url_from_ipc, true, 1, string16()); 2036 1, url_from_ipc, true, 1, string16());
2037 EXPECT_EQ(url_normalized, other_observer.last_url()); 2037 EXPECT_EQ(url_normalized, other_observer.last_url());
2038 } 2038 }
2039 2039
2040 // Test that a if a pending contents is deleted before it is shown, we don't
Charlie Reis 2013/03/07 22:01:02 typo: that a if a
2041 // crash.
2042 TEST_F(WebContentsImplTest, PendingContents) {
2043 scoped_ptr<TestWebContents> other_contents(
2044 static_cast<TestWebContents*>(CreateTestWebContents()));
2045 contents()->AddPendingContents(other_contents.get());
2046 int route_id = other_contents->GetRenderViewHost()->GetRoutingID();
2047 other_contents.reset();
2048 EXPECT_EQ(NULL, contents()->GetCreatedWindow(route_id));
2049 }
2040 2050
2041 } // namespace content 2051 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698