Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 // When spawning a new page from a WebUI page, make sure that the browser and 545 // When spawning a new page from a WebUI page, make sure that the browser and
546 // renderer agree about the length of the history list, and that both get it 546 // renderer agree about the length of the history list, and that both get it
547 // right. 547 // right.
548 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, 548 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
549 CorrectLengthWithNewTabNavigatingFromWebUI) { 549 CorrectLengthWithNewTabNavigatingFromWebUI) {
550 GURL web_ui_page(std::string(kChromeUIScheme) + "://" + 550 GURL web_ui_page(std::string(kChromeUIScheme) + "://" +
551 std::string(kChromeUIGpuHost)); 551 std::string(kChromeUIGpuHost));
552 EXPECT_TRUE(NavigateToURL(shell(), web_ui_page)); 552 EXPECT_TRUE(NavigateToURL(shell(), web_ui_page));
553 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, 553 EXPECT_EQ(BINDINGS_POLICY_WEB_UI,
554 shell()->web_contents()->GetRenderViewHost()->GetEnabledBindings()); 554 shell()->web_contents()->GetMainFrame()->GetEnabledBindings());
555 555
556 ShellAddedObserver observer; 556 ShellAddedObserver observer;
557 std::string page_url = embedded_test_server()->GetURL( 557 std::string page_url = embedded_test_server()->GetURL(
558 "/navigation_controller/simple_page_1.html").spec(); 558 "/navigation_controller/simple_page_1.html").spec();
559 EXPECT_TRUE( 559 EXPECT_TRUE(
560 ExecuteScript(shell(), "window.open('" + page_url + "', '_blank')")); 560 ExecuteScript(shell(), "window.open('" + page_url + "', '_blank')"));
561 Shell* shell2 = observer.GetShell(); 561 Shell* shell2 = observer.GetShell();
562 EXPECT_TRUE(WaitForLoadStop(shell2->web_contents())); 562 EXPECT_TRUE(WaitForLoadStop(shell2->web_contents()));
563 563
564 EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount()); 564 EXPECT_EQ(1, shell2->web_contents()->GetController().GetEntryCount());
(...skipping 6132 matching lines...) Expand 10 before | Expand all | Expand 10 after
6697 NavigationHandleCommitObserver handle_observer(shell()->web_contents(), 6697 NavigationHandleCommitObserver handle_observer(shell()->web_contents(),
6698 kFragmentURL); 6698 kFragmentURL);
6699 EXPECT_TRUE(NavigateToURL(shell(), kFragmentURL)); 6699 EXPECT_TRUE(NavigateToURL(shell(), kFragmentURL));
6700 6700
6701 EXPECT_TRUE(handle_observer.has_committed()); 6701 EXPECT_TRUE(handle_observer.has_committed());
6702 EXPECT_TRUE(handle_observer.was_same_page()); 6702 EXPECT_TRUE(handle_observer.was_same_page());
6703 EXPECT_FALSE(handle_observer.was_renderer_initiated()); 6703 EXPECT_FALSE(handle_observer.was_renderer_initiated());
6704 } 6704 }
6705 6705
6706 } // namespace content 6706 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698