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