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

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

Issue 2808953002: Revert of Followup comments from r460581. (Closed)
Patch Set: manual merge Created 3 years, 8 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 | content/browser/frame_host/render_frame_host_impl.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/frame_host/navigation_handle_impl.h" 10 #include "content/browser/frame_host/navigation_handle_impl.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 ->IsViewSourceMode()); 275 ->IsViewSourceMode());
276 } 276 }
277 277
278 // Ensure that closing a page by running its beforeunload handler doesn't hang 278 // Ensure that closing a page by running its beforeunload handler doesn't hang
279 // if there's an ongoing navigation. 279 // if there's an ongoing navigation.
280 IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, 280 IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest,
281 UnloadDuringNavigation) { 281 UnloadDuringNavigation) {
282 content::WindowedNotificationObserver close_observer( 282 content::WindowedNotificationObserver close_observer(
283 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 283 content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
284 content::Source<content::WebContents>(shell()->web_contents())); 284 content::Source<content::WebContents>(shell()->web_contents()));
285 GURL url = 285 GURL url(
286 embedded_test_server()->GetURL("/page_with_empty_beforeunload.html"); 286 "data:text/html,<html><script>window.onbeforeunload=function(e)"
287 "{}</script></html>");
287 NavigateToURL(shell(), url); 288 NavigateToURL(shell(), url);
288 shell()->LoadURL(GURL("chrome://resources/css/tabs.css")); 289 shell()->LoadURL(GURL("chrome://resources/css/tabs.css"));
289 shell()->web_contents()->DispatchBeforeUnload(); 290 shell()->web_contents()->DispatchBeforeUnload();
290 close_observer.Wait(); 291 close_observer.Wait();
291 } 292 }
292 293
293 // Ensure that the referrer of a navigation is properly sanitized. 294 // Ensure that the referrer of a navigation is properly sanitized.
294 IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, SanitizeReferrer) { 295 IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, SanitizeReferrer) {
295 const GURL kInsecureUrl(embedded_test_server()->GetURL("/title1.html")); 296 const GURL kInsecureUrl(embedded_test_server()->GetURL("/title1.html"));
296 const Referrer kSecureReferrer( 297 const Referrer kSecureReferrer(
(...skipping 18 matching lines...) Expand all
315 EXPECT_EQ(GURL(), 316 EXPECT_EQ(GURL(),
316 root->navigation_request()->navigation_handle()->GetReferrer().url); 317 root->navigation_request()->navigation_handle()->GetReferrer().url);
317 318
318 // The navigation should commit without being blocked. 319 // The navigation should commit without being blocked.
319 EXPECT_TRUE(manager.WaitForResponse()); 320 EXPECT_TRUE(manager.WaitForResponse());
320 manager.WaitForNavigationFinished(); 321 manager.WaitForNavigationFinished();
321 EXPECT_EQ(kInsecureUrl, shell()->web_contents()->GetLastCommittedURL()); 322 EXPECT_EQ(kInsecureUrl, shell()->web_contents()->GetLastCommittedURL());
322 } 323 }
323 324
324 } // namespace content 325 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698