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/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "content/browser/frame_host/interstitial_page_impl.h" | 7 #include "content/browser/frame_host/interstitial_page_impl.h" |
8 #include "content/browser/frame_host/navigation_entry_impl.h" | 8 #include "content/browser/frame_host/navigation_entry_impl.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/renderer_host/test_render_view_host.h" | 10 #include "content/browser/renderer_host/test_render_view_host.h" |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2094 new TestInterstitialPage(other_contents.get(), true, url3, &state, | 2094 new TestInterstitialPage(other_contents.get(), true, url3, &state, |
2095 &deleted); | 2095 &deleted); |
2096 TestInterstitialPageStateGuard state_guard(interstitial); | 2096 TestInterstitialPageStateGuard state_guard(interstitial); |
2097 interstitial->Show(); | 2097 interstitial->Show(); |
2098 interstitial->TestDidNavigate(1, url3); | 2098 interstitial->TestDidNavigate(1, url3); |
2099 EXPECT_TRUE(interstitial->is_showing()); | 2099 EXPECT_TRUE(interstitial->is_showing()); |
2100 EXPECT_EQ(2, other_controller.GetEntryCount()); | 2100 EXPECT_EQ(2, other_controller.GetEntryCount()); |
2101 | 2101 |
2102 // Ensure that we do not allow calling CopyStateFromAndPrune when an | 2102 // Ensure that we do not allow calling CopyStateFromAndPrune when an |
2103 // interstitial is showing in the target. | 2103 // interstitial is showing in the target. |
2104 EXPECT_FALSE(other_controller.CanPruneAllButVisible()); | 2104 EXPECT_FALSE(other_controller.CanPruneAllButLastCommitted()); |
2105 } | 2105 } |
2106 | 2106 |
2107 // Regression test for http://crbug.com/168611 - the URLs passed by the | 2107 // Regression test for http://crbug.com/168611 - the URLs passed by the |
2108 // DidFinishLoad and DidFailLoadWithError IPCs should get filtered. | 2108 // DidFinishLoad and DidFailLoadWithError IPCs should get filtered. |
2109 TEST_F(WebContentsImplTest, FilterURLs) { | 2109 TEST_F(WebContentsImplTest, FilterURLs) { |
2110 TestWebContentsObserver observer(contents()); | 2110 TestWebContentsObserver observer(contents()); |
2111 | 2111 |
2112 // A navigation to about:whatever should always look like a navigation to | 2112 // A navigation to about:whatever should always look like a navigation to |
2113 // about:blank | 2113 // about:blank |
2114 GURL url_normalized(kAboutBlankURL); | 2114 GURL url_normalized(kAboutBlankURL); |
(...skipping 26 matching lines...) Expand all Loading... |
2141 TEST_F(WebContentsImplTest, PendingContents) { | 2141 TEST_F(WebContentsImplTest, PendingContents) { |
2142 scoped_ptr<TestWebContents> other_contents( | 2142 scoped_ptr<TestWebContents> other_contents( |
2143 static_cast<TestWebContents*>(CreateTestWebContents())); | 2143 static_cast<TestWebContents*>(CreateTestWebContents())); |
2144 contents()->AddPendingContents(other_contents.get()); | 2144 contents()->AddPendingContents(other_contents.get()); |
2145 int route_id = other_contents->GetRenderViewHost()->GetRoutingID(); | 2145 int route_id = other_contents->GetRenderViewHost()->GetRoutingID(); |
2146 other_contents.reset(); | 2146 other_contents.reset(); |
2147 EXPECT_EQ(NULL, contents()->GetCreatedWindow(route_id)); | 2147 EXPECT_EQ(NULL, contents()->GetCreatedWindow(route_id)); |
2148 } | 2148 } |
2149 | 2149 |
2150 } // namespace content | 2150 } // namespace content |
OLD | NEW |