| 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/cross_site_transferring_request.h" | 9 #include "content/browser/renderer_host/cross_site_transferring_request.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2142 // about:blank | 2142 // about:blank |
| 2143 GURL url_normalized(kAboutBlankURL); | 2143 GURL url_normalized(kAboutBlankURL); |
| 2144 GURL url_from_ipc("about:whatever"); | 2144 GURL url_from_ipc("about:whatever"); |
| 2145 | 2145 |
| 2146 // We navigate the test WebContents to about:blank, since NavigateAndCommit | 2146 // We navigate the test WebContents to about:blank, since NavigateAndCommit |
| 2147 // will use the given URL to create the NavigationEntry as well, and that | 2147 // will use the given URL to create the NavigationEntry as well, and that |
| 2148 // entry should contain the filtered URL. | 2148 // entry should contain the filtered URL. |
| 2149 contents()->NavigateAndCommit(url_normalized); | 2149 contents()->NavigateAndCommit(url_normalized); |
| 2150 | 2150 |
| 2151 // Check that an IPC with about:whatever is correctly normalized. | 2151 // Check that an IPC with about:whatever is correctly normalized. |
| 2152 contents()->TestDidFinishLoad(1, url_from_ipc, true); | 2152 contents()->TestDidFinishLoad(url_from_ipc, true); |
| 2153 | 2153 |
| 2154 EXPECT_EQ(url_normalized, observer.last_url()); | 2154 EXPECT_EQ(url_normalized, observer.last_url()); |
| 2155 | 2155 |
| 2156 // Create and navigate another WebContents. | 2156 // Create and navigate another WebContents. |
| 2157 scoped_ptr<TestWebContents> other_contents( | 2157 scoped_ptr<TestWebContents> other_contents( |
| 2158 static_cast<TestWebContents*>(CreateTestWebContents())); | 2158 static_cast<TestWebContents*>(CreateTestWebContents())); |
| 2159 TestWebContentsObserver other_observer(other_contents.get()); | 2159 TestWebContentsObserver other_observer(other_contents.get()); |
| 2160 other_contents->NavigateAndCommit(url_normalized); | 2160 other_contents->NavigateAndCommit(url_normalized); |
| 2161 | 2161 |
| 2162 // Check that an IPC with about:whatever is correctly normalized. | 2162 // Check that an IPC with about:whatever is correctly normalized. |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2317 dy = 0; | 2317 dy = 0; |
| 2318 event = SyntheticWebMouseWheelEventBuilder::Build(2, dy, modifiers, false); | 2318 event = SyntheticWebMouseWheelEventBuilder::Build(2, dy, modifiers, false); |
| 2319 EXPECT_FALSE(contents()->HandleWheelEvent(event)); | 2319 EXPECT_FALSE(contents()->HandleWheelEvent(event)); |
| 2320 EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount()); | 2320 EXPECT_EQ(0, delegate->GetAndResetContentsZoomChangedCallCount()); |
| 2321 | 2321 |
| 2322 // Ensure pointers to the delegate aren't kept beyond it's lifetime. | 2322 // Ensure pointers to the delegate aren't kept beyond it's lifetime. |
| 2323 contents()->SetDelegate(NULL); | 2323 contents()->SetDelegate(NULL); |
| 2324 } | 2324 } |
| 2325 | 2325 |
| 2326 } // namespace content | 2326 } // namespace content |
| OLD | NEW |