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

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

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Addressed all jam@ latest comments. 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 DocumentState state; 679 DocumentState state;
680 state.set_navigation_state(NavigationStateImpl::CreateContentInitiated()); 680 state.set_navigation_state(NavigationStateImpl::CreateContentInitiated());
681 681
682 // Navigations to normal HTTP URLs can be handled locally. 682 // Navigations to normal HTTP URLs can be handled locally.
683 blink::WebURLRequest request(GURL("http://foo.com")); 683 blink::WebURLRequest request(GURL("http://foo.com"));
684 request.setFetchRequestMode(blink::WebURLRequest::FetchRequestModeNavigate); 684 request.setFetchRequestMode(blink::WebURLRequest::FetchRequestModeNavigate);
685 request.setFetchCredentialsMode( 685 request.setFetchCredentialsMode(
686 blink::WebURLRequest::FetchCredentialsModeInclude); 686 blink::WebURLRequest::FetchCredentialsModeInclude);
687 request.setFetchRedirectMode(blink::WebURLRequest::FetchRedirectModeManual); 687 request.setFetchRedirectMode(blink::WebURLRequest::FetchRedirectModeManual);
688 request.setFrameType(blink::WebURLRequest::FrameTypeTopLevel); 688 request.setFrameType(blink::WebURLRequest::FrameTypeTopLevel);
689 request.setRequestContext(blink::WebURLRequest::RequestContextInternal);
689 blink::WebFrameClient::NavigationPolicyInfo policy_info(request); 690 blink::WebFrameClient::NavigationPolicyInfo policy_info(request);
690 policy_info.navigationType = blink::WebNavigationTypeLinkClicked; 691 policy_info.navigationType = blink::WebNavigationTypeLinkClicked;
691 policy_info.defaultPolicy = blink::WebNavigationPolicyCurrentTab; 692 policy_info.defaultPolicy = blink::WebNavigationPolicyCurrentTab;
692 blink::WebNavigationPolicy policy = frame()->decidePolicyForNavigation( 693 blink::WebNavigationPolicy policy = frame()->decidePolicyForNavigation(
693 policy_info); 694 policy_info);
694 if (!IsBrowserSideNavigationEnabled()) { 695 if (!IsBrowserSideNavigationEnabled()) {
695 EXPECT_EQ(blink::WebNavigationPolicyCurrentTab, policy); 696 EXPECT_EQ(blink::WebNavigationPolicyCurrentTab, policy);
696 } else { 697 } else {
697 // If this is a renderer-initiated navigation that just begun, it should 698 // If this is a renderer-initiated navigation that just begun, it should
698 // stop and be sent to the browser. 699 // stop and be sent to the browser.
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 ExpectPauseAndResume(3); 2562 ExpectPauseAndResume(3);
2562 blink::WebScriptSource source2( 2563 blink::WebScriptSource source2(
2563 WebString::fromUTF8("function func2() { func1(); }; func2();")); 2564 WebString::fromUTF8("function func2() { func1(); }; func2();"));
2564 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); 2565 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1);
2565 2566
2566 EXPECT_FALSE(IsPaused()); 2567 EXPECT_FALSE(IsPaused());
2567 Detach(); 2568 Detach();
2568 } 2569 }
2569 2570
2570 } // namespace content 2571 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698