OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |