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