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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)
Patch Set: Created 4 years 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 (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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 policy_info.navigationType = kNavTypes[i]; 745 policy_info.navigationType = kNavTypes[i];
746 746
747 blink::WebNavigationPolicy policy = frame()->decidePolicyForNavigation( 747 blink::WebNavigationPolicy policy = frame()->decidePolicyForNavigation(
748 policy_info); 748 policy_info);
749 EXPECT_EQ(blink::WebNavigationPolicyIgnore, policy); 749 EXPECT_EQ(blink::WebNavigationPolicyIgnore, policy);
750 } 750 }
751 } 751 }
752 752
753 TEST_F(RenderViewImplTest, DecideNavigationPolicyForWebUI) { 753 TEST_F(RenderViewImplTest, DecideNavigationPolicyForWebUI) {
754 // Enable bindings to simulate a WebUI view. 754 // Enable bindings to simulate a WebUI view.
755 view()->OnAllowBindings(BINDINGS_POLICY_WEB_UI); 755 view()->GetMainRenderFrame()->AllowBindings(BINDINGS_POLICY_WEB_UI);
756 756
757 DocumentState state; 757 DocumentState state;
758 state.set_navigation_state(NavigationStateImpl::CreateContentInitiated()); 758 state.set_navigation_state(NavigationStateImpl::CreateContentInitiated());
759 759
760 // Navigations to normal HTTP URLs will be sent to browser process. 760 // Navigations to normal HTTP URLs will be sent to browser process.
761 blink::WebURLRequest request(GURL("http://foo.com")); 761 blink::WebURLRequest request(GURL("http://foo.com"));
762 blink::WebFrameClient::NavigationPolicyInfo policy_info(request); 762 blink::WebFrameClient::NavigationPolicyInfo policy_info(request);
763 policy_info.navigationType = blink::WebNavigationTypeLinkClicked; 763 policy_info.navigationType = blink::WebNavigationTypeLinkClicked;
764 policy_info.defaultPolicy = blink::WebNavigationPolicyCurrentTab; 764 policy_info.defaultPolicy = blink::WebNavigationPolicyCurrentTab;
765 765
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2550 ExpectPauseAndResume(3); 2550 ExpectPauseAndResume(3);
2551 blink::WebScriptSource source2( 2551 blink::WebScriptSource source2(
2552 WebString::fromUTF8("function func2() { func1(); }; func2();")); 2552 WebString::fromUTF8("function func2() { func1(); }; func2();"));
2553 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); 2553 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1);
2554 2554
2555 EXPECT_FALSE(IsPaused()); 2555 EXPECT_FALSE(IsPaused());
2556 Detach(); 2556 Detach();
2557 } 2557 }
2558 2558
2559 } // namespace content 2559 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698