OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |