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 "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 551 |
552 // When spawning a new page from a WebUI page, make sure that the browser and | 552 // When spawning a new page from a WebUI page, make sure that the browser and |
553 // renderer agree about the length of the history list, and that both get it | 553 // renderer agree about the length of the history list, and that both get it |
554 // right. | 554 // right. |
555 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, | 555 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
556 CorrectLengthWithNewTabNavigatingFromWebUI) { | 556 CorrectLengthWithNewTabNavigatingFromWebUI) { |
557 GURL web_ui_page(std::string(kChromeUIScheme) + "://" + | 557 GURL web_ui_page(std::string(kChromeUIScheme) + "://" + |
558 std::string(kChromeUIGpuHost)); | 558 std::string(kChromeUIGpuHost)); |
559 EXPECT_TRUE(NavigateToURL(shell(), web_ui_page)); | 559 EXPECT_TRUE(NavigateToURL(shell(), web_ui_page)); |
560 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 560 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, |
561 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings()); | 561 shell()->web_contents()->GetMainFrame()->GetEnabledBindings()); |
562 | 562 |
563 ShellAddedObserver observer; | 563 ShellAddedObserver observer; |
564 std::string page_url = embedded_test_server()->GetURL( | 564 std::string page_url = embedded_test_server()->GetURL( |
565 "/navigation_controller/simple_page_1.html").spec(); | 565 "/navigation_controller/simple_page_1.html").spec(); |
566 EXPECT_TRUE( | 566 EXPECT_TRUE( |
567 ExecuteScript(shell(), "window.open('" + page_url + "', '_blank')")); | 567 ExecuteScript(shell(), "window.open('" + page_url + "', '_blank')")); |
568 Shell* shell2 = observer.GetShell(); | 568 Shell* shell2 = observer.GetShell(); |
569 EXPECT_TRUE(WaitForLoadStop(shell2->web_contents())); | 569 EXPECT_TRUE(WaitForLoadStop(shell2->web_contents())); |
570 | 570 |
571 EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount()); | 571 EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount()); |
(...skipping 6458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7030 NavigationHandleCommitObserver handle_observer(shell()->web_contents(), | 7030 NavigationHandleCommitObserver handle_observer(shell()->web_contents(), |
7031 kFragmentURL); | 7031 kFragmentURL); |
7032 EXPECT_TRUE(NavigateToURL(shell(), kFragmentURL)); | 7032 EXPECT_TRUE(NavigateToURL(shell(), kFragmentURL)); |
7033 | 7033 |
7034 EXPECT_TRUE(handle_observer.has_committed()); | 7034 EXPECT_TRUE(handle_observer.has_committed()); |
7035 EXPECT_TRUE(handle_observer.was_same_page()); | 7035 EXPECT_TRUE(handle_observer.was_same_page()); |
7036 EXPECT_FALSE(handle_observer.was_renderer_initiated()); | 7036 EXPECT_FALSE(handle_observer.was_renderer_initiated()); |
7037 } | 7037 } |
7038 | 7038 |
7039 } // namespace content | 7039 } // namespace content |
OLD | NEW |