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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 // When spawning a new page from a WebUI page, make sure that the browser and | 267 // When spawning a new page from a WebUI page, make sure that the browser and |
268 // renderer agree about the length of the history list, and that both get it | 268 // renderer agree about the length of the history list, and that both get it |
269 // right. | 269 // right. |
270 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, | 270 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
271 CorrectLengthWithNewTabNavigatingFromWebUI) { | 271 CorrectLengthWithNewTabNavigatingFromWebUI) { |
272 GURL web_ui_page(std::string(kChromeUIScheme) + "://" + | 272 GURL web_ui_page(std::string(kChromeUIScheme) + "://" + |
273 std::string(kChromeUIGpuHost)); | 273 std::string(kChromeUIGpuHost)); |
274 EXPECT_TRUE(NavigateToURL(shell(), web_ui_page)); | 274 EXPECT_TRUE(NavigateToURL(shell(), web_ui_page)); |
275 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 275 EXPECT_TRUE( |
276 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings()); | 276 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings() & |
| 277 BINDINGS_POLICY_WEB_UI); |
277 | 278 |
278 ShellAddedObserver observer; | 279 ShellAddedObserver observer; |
279 std::string page_url = embedded_test_server()->GetURL( | 280 std::string page_url = embedded_test_server()->GetURL( |
280 "/navigation_controller/simple_page_1.html").spec(); | 281 "/navigation_controller/simple_page_1.html").spec(); |
281 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), | 282 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), |
282 "window.open('" + page_url + "', '_blank')")); | 283 "window.open('" + page_url + "', '_blank')")); |
283 Shell* shell2 = observer.GetShell(); | 284 Shell* shell2 = observer.GetShell(); |
284 EXPECT_TRUE(WaitForLoadStop(shell2->web_contents())); | 285 EXPECT_TRUE(WaitForLoadStop(shell2->web_contents())); |
285 | 286 |
286 EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount()); | 287 EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount()); |
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2518 EXPECT_EQ(original_url, capturer.all_params()[1].url); | 2519 EXPECT_EQ(original_url, capturer.all_params()[1].url); |
2519 EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); | 2520 EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); |
2520 } | 2521 } |
2521 | 2522 |
2522 // Make sure the renderer is still alive. | 2523 // Make sure the renderer is still alive. |
2523 EXPECT_TRUE( | 2524 EXPECT_TRUE( |
2524 ExecuteScript(shell()->web_contents(), "console.log('Success');")); | 2525 ExecuteScript(shell()->web_contents(), "console.log('Success');")); |
2525 } | 2526 } |
2526 | 2527 |
2527 } // namespace content | 2528 } // namespace content |
OLD | NEW |