| 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 "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/frame_host/cross_process_frame_connector.h" | 10 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 NOTIFICATION_NAV_ENTRY_COMMITTED, | 233 NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 234 Source<NavigationController>( | 234 Source<NavigationController>( |
| 235 &window->web_contents()->GetController())); | 235 &window->web_contents()->GetController())); |
| 236 if (!ExecuteScript(window->web_contents(), script)) | 236 if (!ExecuteScript(window->web_contents(), script)) |
| 237 return false; | 237 return false; |
| 238 load_observer.Wait(); | 238 load_observer.Wait(); |
| 239 | 239 |
| 240 return true; | 240 return true; |
| 241 } | 241 } |
| 242 | 242 |
| 243 void SitePerProcessBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 243 void SitePerProcessBrowserTest::SetUpCommandLine( |
| 244 base::CommandLine* command_line) { |
| 244 command_line->AppendSwitch(switches::kSitePerProcess); | 245 command_line->AppendSwitch(switches::kSitePerProcess); |
| 245 }; | 246 }; |
| 246 | 247 |
| 247 void SitePerProcessBrowserTest::SetUpOnMainThread() { | 248 void SitePerProcessBrowserTest::SetUpOnMainThread() { |
| 248 host_resolver()->AddRule("*", "127.0.0.1"); | 249 host_resolver()->AddRule("*", "127.0.0.1"); |
| 249 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 250 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 250 SetupCrossSiteRedirector(embedded_test_server()); | 251 SetupCrossSiteRedirector(embedded_test_server()); |
| 251 } | 252 } |
| 252 | 253 |
| 253 // Ensure that navigating subframes in --site-per-process mode works and the | 254 // Ensure that navigating subframes in --site-per-process mode works and the |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 params.frame_tree_node_id = child->frame_tree_node_id(); | 1101 params.frame_tree_node_id = child->frame_tree_node_id(); |
| 1101 child->navigator()->GetController()->LoadURLWithParams(params); | 1102 child->navigator()->GetController()->LoadURLWithParams(params); |
| 1102 nav_observer.Wait(); | 1103 nav_observer.Wait(); |
| 1103 | 1104 |
| 1104 // Verify that the navigation succeeded and the expected URL was loaded. | 1105 // Verify that the navigation succeeded and the expected URL was loaded. |
| 1105 EXPECT_TRUE(observer.navigation_succeeded()); | 1106 EXPECT_TRUE(observer.navigation_succeeded()); |
| 1106 EXPECT_EQ(url, observer.navigation_url()); | 1107 EXPECT_EQ(url, observer.navigation_url()); |
| 1107 } | 1108 } |
| 1108 | 1109 |
| 1109 } // namespace content | 1110 } // namespace content |
| OLD | NEW |