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

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: rebase Created 3 years, 11 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 (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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 policy_info.navigationType = kNavTypes[i]; 747 policy_info.navigationType = kNavTypes[i];
748 748
749 blink::WebNavigationPolicy policy = frame()->decidePolicyForNavigation( 749 blink::WebNavigationPolicy policy = frame()->decidePolicyForNavigation(
750 policy_info); 750 policy_info);
751 EXPECT_EQ(blink::WebNavigationPolicyIgnore, policy); 751 EXPECT_EQ(blink::WebNavigationPolicyIgnore, policy);
752 } 752 }
753 } 753 }
754 754
755 TEST_F(RenderViewImplTest, DecideNavigationPolicyForWebUI) { 755 TEST_F(RenderViewImplTest, DecideNavigationPolicyForWebUI) {
756 // Enable bindings to simulate a WebUI view. 756 // Enable bindings to simulate a WebUI view.
757 view()->OnAllowBindings(BINDINGS_POLICY_WEB_UI); 757 view()->GetMainRenderFrame()->AllowBindings(BINDINGS_POLICY_WEB_UI);
758 758
759 DocumentState state; 759 DocumentState state;
760 state.set_navigation_state(NavigationStateImpl::CreateContentInitiated()); 760 state.set_navigation_state(NavigationStateImpl::CreateContentInitiated());
761 761
762 // Navigations to normal HTTP URLs will be sent to browser process. 762 // Navigations to normal HTTP URLs will be sent to browser process.
763 blink::WebURLRequest request(GURL("http://foo.com")); 763 blink::WebURLRequest request(GURL("http://foo.com"));
764 blink::WebFrameClient::NavigationPolicyInfo policy_info(request); 764 blink::WebFrameClient::NavigationPolicyInfo policy_info(request);
765 policy_info.navigationType = blink::WebNavigationTypeLinkClicked; 765 policy_info.navigationType = blink::WebNavigationTypeLinkClicked;
766 policy_info.defaultPolicy = blink::WebNavigationPolicyCurrentTab; 766 policy_info.defaultPolicy = blink::WebNavigationPolicyCurrentTab;
767 767
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 ExpectPauseAndResume(3); 2565 ExpectPauseAndResume(3);
2566 blink::WebScriptSource source2( 2566 blink::WebScriptSource source2(
2567 WebString::fromUTF8("function func2() { func1(); }; func2();")); 2567 WebString::fromUTF8("function func2() { func1(); }; func2();"));
2568 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1); 2568 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1);
2569 2569
2570 EXPECT_FALSE(IsPaused()); 2570 EXPECT_FALSE(IsPaused());
2571 Detach(); 2571 Detach();
2572 } 2572 }
2573 2573
2574 } // namespace content 2574 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698