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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 1683593002: Don't use pending NavigationEntries for navigation transfers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from review Created 4 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/navigator_impl.cc » ('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 "content/browser/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 script = "var iframe = document.createElement('iframe');" 500 script = "var iframe = document.createElement('iframe');"
501 "iframe.src = 'data:text/html,<p>some page</p>';" 501 "iframe.src = 'data:text/html,<p>some page</p>';"
502 "document.body.appendChild(iframe);"; 502 "document.body.appendChild(iframe);";
503 EXPECT_TRUE(content::ExecuteScript(new_root->current_frame_host(), script)); 503 EXPECT_TRUE(content::ExecuteScript(new_root->current_frame_host(), script));
504 // The success check is of the last-committed entry, and there is none. 504 // The success check is of the last-committed entry, and there is none.
505 WaitForLoadStopWithoutSuccessCheck(new_shell->web_contents()); 505 WaitForLoadStopWithoutSuccessCheck(new_shell->web_contents());
506 506
507 ASSERT_EQ(1U, new_root->child_count()); 507 ASSERT_EQ(1U, new_root->child_count());
508 ASSERT_NE(nullptr, new_root->child_at(0)); 508 ASSERT_NE(nullptr, new_root->child_at(0));
509 509
510 // Navigate it. 510 // Navigate it cross-site.
511 GURL frame_url = embedded_test_server()->GetURL( 511 GURL frame_url = embedded_test_server()->GetURL(
512 "/navigation_controller/simple_page_2.html"); 512 "foo.com", "/navigation_controller/simple_page_2.html");
513 script = "location.assign('" + frame_url.spec() + "')"; 513 script = "location.assign('" + frame_url.spec() + "')";
514 EXPECT_TRUE(content::ExecuteScript( 514 EXPECT_TRUE(content::ExecuteScript(
515 new_root->child_at(0)->current_frame_host(), script)); 515 new_root->child_at(0)->current_frame_host(), script));
516 WaitForLoadStopWithoutSuccessCheck(new_shell->web_contents());
Charlie Reis 2016/03/30 15:26:08 Before the change in this CL, doing this crashes i
alexmos 2016/03/30 16:50:41 Nice!
516 517
517 // Success is not crashing, and not navigating. 518 // Success is not crashing, and not navigating.
518 EXPECT_EQ(nullptr, 519 EXPECT_EQ(nullptr,
519 new_shell->web_contents()->GetController().GetLastCommittedEntry()); 520 new_shell->web_contents()->GetController().GetLastCommittedEntry());
520 } 521 }
521 522
522 namespace { 523 namespace {
523 524
524 class FrameNavigateParamsCapturer : public WebContentsObserver { 525 class FrameNavigateParamsCapturer : public WebContentsObserver {
525 public: 526 public:
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
3514 observer.Wait(); 3515 observer.Wait();
3515 3516
3516 EXPECT_EQ(3, controller.GetEntryCount()); 3517 EXPECT_EQ(3, controller.GetEntryCount());
3517 EXPECT_EQ(3, RendererHistoryLength(shell())); 3518 EXPECT_EQ(3, RendererHistoryLength(shell()));
3518 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); 3519 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex());
3519 3520
3520 EXPECT_EQ(frame_url_1, frame->current_url()); 3521 EXPECT_EQ(frame_url_1, frame->current_url());
3521 } 3522 }
3522 3523
3523 } // namespace content 3524 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698