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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2096453002: Don't commit the blocked URL when a frame is blocked by XFrameOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace updateForSameDocumentNavigation with explicit code to update the URL Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 6283 matching lines...) Expand 10 before | Expand all | Expand 10 after
6294 // Navigate the subframe to a blocked URL. 6294 // Navigate the subframe to a blocked URL.
6295 TestNavigationObserver load_observer(shell()->web_contents()); 6295 TestNavigationObserver load_observer(shell()->web_contents());
6296 EXPECT_TRUE(ExecuteScript( 6296 EXPECT_TRUE(ExecuteScript(
6297 shell()->web_contents(), 6297 shell()->web_contents(),
6298 "frames[0].location.href = '" + blocked_urls[i].spec() + "';")); 6298 "frames[0].location.href = '" + blocked_urls[i].spec() + "';"));
6299 load_observer.Wait(); 6299 load_observer.Wait();
6300 6300
6301 // The blocked frame's origin should become unique. 6301 // The blocked frame's origin should become unique.
6302 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize()); 6302 EXPECT_EQ("null", root->child_at(0)->current_origin().Serialize());
6303 6303
6304 // Ensure that we don't use the blocked URL as the blocked frame's last
6305 // committed URL (see https://crbug.com/622385).
6306 EXPECT_NE(root->child_at(0)->current_frame_host()->GetLastCommittedURL(),
6307 blocked_urls[i]);
6308
6304 // The blocked frame should still fire a load event in its parent's process. 6309 // The blocked frame should still fire a load event in its parent's process.
6305 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); 6310 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
6306 6311
6307 // Check that the current RenderFrameHost has stopped loading. 6312 // Check that the current RenderFrameHost has stopped loading.
6308 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading()); 6313 EXPECT_FALSE(root->child_at(0)->current_frame_host()->is_loading());
6309 6314
6310 // The blocked navigation should behave like an empty 200 response. Make 6315 // The blocked navigation should behave like an empty 200 response. Make
6311 // sure that the frame's document.title is empty: this double-checks both 6316 // sure that the frame's document.title is empty: this double-checks both
6312 // that the blocked URL's contents wasn't loaded, and that the old page 6317 // that the blocked URL's contents wasn't loaded, and that the old page
6313 // isn't active anymore (both of these pages have non-empty titles). 6318 // isn't active anymore (both of these pages have non-empty titles).
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
7208 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0))); 7213 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)));
7209 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); 7214 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0)));
7210 7215
7211 // Cross-site navigation should preserve the fullscreen flags. 7216 // Cross-site navigation should preserve the fullscreen flags.
7212 NavigateFrameToURL(root->child_at(0)->child_at(0), 7217 NavigateFrameToURL(root->child_at(0)->child_at(0),
7213 embedded_test_server()->GetURL("d.com", "/title1.html")); 7218 embedded_test_server()->GetURL("d.com", "/title1.html"));
7214 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0))); 7219 EXPECT_TRUE(is_fullscreen_allowed(root->child_at(0)->child_at(0)));
7215 } 7220 }
7216 7221
7217 } // namespace content 7222 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698