| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/browser/frame_host/frame_navigation_entry.h" | 8 #include "content/browser/frame_host/frame_navigation_entry.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "net/dns/mock_host_resolver.h" | 30 #include "net/dns/mock_host_resolver.h" |
| 31 #include "net/test/embedded_test_server/embedded_test_server.h" | 31 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 32 #include "net/test/url_request/url_request_failed_job.h" | 32 #include "net/test/url_request/url_request_failed_job.h" |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 | 35 |
| 36 class NavigationControllerBrowserTest : public ContentBrowserTest { | 36 class NavigationControllerBrowserTest : public ContentBrowserTest { |
| 37 protected: | 37 protected: |
| 38 void SetUpOnMainThread() override { | 38 void SetUpOnMainThread() override { |
| 39 host_resolver()->AddRule("*", "127.0.0.1"); | 39 host_resolver()->AddRule("*", "127.0.0.1"); |
| 40 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 40 ASSERT_TRUE(embedded_test_server()->Start()); |
| 41 } | 41 } |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Ensure that tests can navigate subframes cross-site in both default mode and | 44 // Ensure that tests can navigate subframes cross-site in both default mode and |
| 45 // --site-per-process, but that they only go cross-process in the latter. | 45 // --site-per-process, but that they only go cross-process in the latter. |
| 46 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadCrossSiteSubframe) { | 46 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadCrossSiteSubframe) { |
| 47 // Load a main frame with a subframe. | 47 // Load a main frame with a subframe. |
| 48 GURL main_url(embedded_test_server()->GetURL( | 48 GURL main_url(embedded_test_server()->GetURL( |
| 49 "/navigation_controller/page_with_iframe.html")); | 49 "/navigation_controller/page_with_iframe.html")); |
| 50 NavigateToURL(shell(), main_url); | 50 NavigateToURL(shell(), main_url); |
| (...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2381 EXPECT_EQ(original_url, capturer.all_params()[1].url); | 2381 EXPECT_EQ(original_url, capturer.all_params()[1].url); |
| 2382 EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); | 2382 EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); |
| 2383 } | 2383 } |
| 2384 | 2384 |
| 2385 // Make sure the renderer is still alive. | 2385 // Make sure the renderer is still alive. |
| 2386 EXPECT_TRUE( | 2386 EXPECT_TRUE( |
| 2387 ExecuteScript(shell()->web_contents(), "console.log('Success');")); | 2387 ExecuteScript(shell()->web_contents(), "console.log('Success');")); |
| 2388 } | 2388 } |
| 2389 | 2389 |
| 2390 } // namespace content | 2390 } // namespace content |
| OLD | NEW |